webpack-require-weak
v1.0.1
Published
Require a webpack resolveWeak id
Downloads
5,205
Readme
webpack-require-weak
Require a webpack resolveWeak id
const isWebpackBundle = require('is-webpack-bundle');
const webpackRequireWeak = require('webpack-require-weak');
let myModule;
if (isWebpackBundle) {
myModule = webpackRequireWeak(require.resolveWeak('./path/to/module'));
} else {
myModule = require('./path/to/module');
}