safe-externals-loader
v1.0.4
Published
Safe Externals Loader for Webpack =================================
Downloads
19
Readme
Safe Externals Loader for Webpack
Load webpack externals only if they are available globally, else require them
Usage example:
const safeExternals = {
jquery: ['jQuery', '$'],
react: ['React']
};
module.exports = {
entry: './index.js',
output: {
path: __dirname,
filename: 'bundle.js'
},
module: {
loaders: [{
test: /\.js$/,
loader: 'safe-externals-loader',
query: JSON.stringify(safeExternals)
}]
}
};