webpack-require-weak

Require a webpack resolveWeak id

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
webpack-require-weak
1.0.17 years ago7 years agoMinified + gzip package size for webpack-require-weak in KB

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');
}