Set dynamic webpack import path (#208)

* Set dynamic webpack import path

* Cleanup
This commit is contained in:
Matt (IPv4) Cowley
2021-01-05 15:29:13 +00:00
committed by GitHub
parent 0cefd5ddef
commit 479412888d
4 changed files with 26 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright 2020 DigitalOcean
Copyright 2021 DigitalOcean
This code is licensed under the MIT License.
You may obtain a copy of the License at
@@ -27,6 +27,7 @@ THE SOFTWARE.
const path = require('path');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
const WebpackRequireFrom = require('webpack-require-from');
module.exports = {
publicPath: './',
@@ -38,6 +39,7 @@ module.exports = {
plugins: [
process.argv.includes('--analyze') && new BundleAnalyzerPlugin(),
process.argv.includes('--analyze') && new DuplicatePackageCheckerPlugin(),
new WebpackRequireFrom({ replaceSrcMethodName: '__replaceWebpackDynamicImport' }),
].filter(x => !!x),
},
chainWebpack: config => {