mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-08-21 21:54:56 +08:00
Fix webpack dynamic imports (#266)
* Update all deps * Update dynamic import injection
This commit is contained in:
committed by
GitHub
parent
8155902f79
commit
b05f301c21
@@ -40,9 +40,16 @@ module.exports = {
|
||||
configureWebpack: {
|
||||
node: false, // Disable Node.js polyfills (Buffer etc.) -- This will be default in Webpack 5
|
||||
plugins: [
|
||||
// Fix dynamic imports from CDN (inject as first entry point before any imports can happen)
|
||||
{ apply: compiler => {
|
||||
compiler.options.entry.app.import.unshift(
|
||||
path.join(__dirname, 'src', 'nginxconfig', 'build', 'webpack-dynamic-import.js'),
|
||||
);
|
||||
} },
|
||||
new WebpackRequireFrom({ methodName: '__webpackDynamicImportURL' }),
|
||||
// Analyze the bundle
|
||||
process.argv.includes('--analyze') && new BundleAnalyzerPlugin(),
|
||||
process.argv.includes('--analyze') && new DuplicatePackageCheckerPlugin(),
|
||||
new WebpackRequireFrom({ replaceSrcMethodName: '__replaceWebpackDynamicImport' }),
|
||||
].filter(x => !!x),
|
||||
},
|
||||
chainWebpack: config => {
|
||||
|
Reference in New Issue
Block a user