Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rewiremock

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rewiremock - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

rewiremock.d.ts

3

lib/plugins/common/aliases.js

@@ -22,2 +22,3 @@ 'use strict';

var FS_MODULE_NAME = 'fs';
var DEFAULT_CONFIG_NAMES = ['webpack.config.js', 'webpack.config.babel.js'];

@@ -33,3 +34,3 @@

try {
var fs = require('fs');
var fs = require(FS_MODULE_NAME);
return !fs.accessSync(path, fs.F_OK) && path;

@@ -36,0 +37,0 @@ } catch (e) {

{
"name": "rewiremock",
"version": "2.1.0",
"version": "2.1.1",
"description": "Easy and es6 compatible dependency mocking tool.",

@@ -11,3 +11,3 @@ "main": "lib/index.js",

"test:pick": "BABEL_ENV=test mocha --compilers js:babel-core/register",
"test:karma": "node ./node_modules/karma/bin/karma --single-run --browsers PhantomJS",
"test:karma": "node ./node_modules/karma/bin/karma start --single-run --browsers PhantomJS",
"test:browser": "node ./node_modules/karma/bin/karma start --browsers Chrome",

@@ -21,3 +21,4 @@ "build": "babel src -d lib",

"lib",
"webpack"
"webpack",
"rewiremock.d.ts"
],

@@ -24,0 +25,0 @@ "keywords": [

@@ -1,9 +0,13 @@

const ConcatSource = require("webpack-sources").ConcatSource;
const {relative} = require("path");
const {ConcatSource} = require("webpack-sources");
const injectString = "/***/if(typeof __webpack_require__!=='undefined'){__webpack_require__ = __webpack_require__('./webpack/interceptor.js')(__webpack_require__, module);}\n";
const file = './' + relative(process.cwd(), __dirname + '/interceptor.js');
const injectString = "/***/if(typeof __webpack_require__!=='undefined'){__webpack_require__ = __webpack_require__('" + file + "')(__webpack_require__, module);}\n";
class RewiremockPlugin {
apply(compiler) {
compiler.plugin('compilation', function (compilation) {
compilation.moduleTemplate.plugin("render", function (moduleSource, module) {
compilation.moduleTemplate.plugin("render", function (moduleSource) {
const source = new ConcatSource();

@@ -10,0 +14,0 @@ source.add(injectString);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc