Open klouskingsley opened 7 years ago
I try to use commonjs2 style in DllPlugin and the browser return an error
Uncaught ReferenceError: require is not defined
here is my config files
var webpack = require('webpack')
module.exports = { output: { path: './dll', filename: '[name].js', library: '[name]', libraryTarget: 'commonjs2' }, entry: { test: ['./js/lib/browser.js'] }, plugins: [ new webpack.DllPlugin({ path: './dll/[name]-manifest.json', name: '[name]', context: __dirname }) ] }
- webpack config fle
module.exports = { output: { path: dirname, filename: '[name].bundle.js', }, entry: { app: ['./app.js'] }, plugins: [ new webpack.DllReferencePlugin({ manifest: require('./dll/test-manifest.json'), context: dirname, sourceType: 'commonjs2', name: './dll/test.js' }) ] }
Does somebody find solution here?
I had the same error 🤔
I try to use commonjs2 style in DllPlugin and the browser return an error
here is my config files
module.exports = { output: { path: './dll', filename: '[name].js', library: '[name]', libraryTarget: 'commonjs2' }, entry: { test: ['./js/lib/browser.js'] }, plugins: [ new webpack.DllPlugin({ path: './dll/[name]-manifest.json', name: '[name]', context: __dirname }) ] }
var webpack = require('webpack')
module.exports = { output: { path: dirname, filename: '[name].bundle.js', }, entry: { app: ['./app.js'] }, plugins: [ new webpack.DllReferencePlugin({ manifest: require('./dll/test-manifest.json'), context: dirname, sourceType: 'commonjs2', name: './dll/test.js' }) ] }