
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
mimic-webpack
Advanced tools
Mimics a webpack config's filename extensions, aliases, and loaders inside of the current node process
mimic-webpackMimics a webpack config's filename extensions, aliases, and loaders inside of the current node process.
You might want to mimic.install():
eslint-plugin-require-path-exists.npm install mimic-webpack
In your entry file:
var Mimic = require('mimic-webpack');
new Mimic({
webpackConfig: { // pass your webpack config here
resolve: {
extensions: ['.foo'],
alias: {
myModule: 'theirModule'
}
},
module: {
loaders: [{
test: /\.foo$/,
loader: 'foo-loader'
}]
}
}
}).install();
myModule.foo:
// code to be processed with foo-loader
Now, anywhere in your project, you can do this:
require('theirModule');
In the above example:
theirModule is aliased to myModule due to resolve.alias.foo extension is inferred due to `resolve.extensions.foo-loader because of module.loadersMimic.prototype.install - configures require in the current node process to behave according to the webpack config specified by options.webpackConfig passed to the constructor. Returns the current instance.Mimic.prototype.uninstall - un-does what Mimic.prototype.install did. Returns the current instance.Mimic.restore - restores configuration to the way it was before Mimic was required in.Paths that were resolved using custom properties in require.extensions will continue to resolve the same even after Mimic.restore or Mimic.prototype.uninstall have been called.
myMimic.uninstall();
require.resolve('theirModule'); // still resolves to myModule.foo.
install and uninstall can only be run once per instance.FAQs
Mimics a webpack config's filename extensions, aliases, and loaders inside of the current node process
We found that mimic-webpack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.