2020-11-19 19:22:43 +00:00
|
|
|
const { merge } = require('webpack-merge');
|
|
|
|
const common = require('./webpack.common.js');
|
2022-04-01 19:35:01 +00:00
|
|
|
|
2020-11-19 19:22:43 +00:00
|
|
|
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
2022-04-04 20:37:43 +00:00
|
|
|
const CircularDependencyPlugin = require('circular-dependency-plugin');
|
2020-11-19 19:22:43 +00:00
|
|
|
|
|
|
|
module.exports = merge(common, {
|
|
|
|
mode: 'development',
|
2020-11-20 12:40:00 +00:00
|
|
|
devtool: 'source-map',
|
2020-11-19 19:22:43 +00:00
|
|
|
plugins: [
|
|
|
|
new BundleAnalyzerPlugin({
|
|
|
|
openAnalyzer: false,
|
|
|
|
analyzerMode: 'static'
|
2022-04-04 20:37:43 +00:00
|
|
|
}),
|
|
|
|
new CircularDependencyPlugin({
|
|
|
|
// exclude detection of files based on a RegExp
|
|
|
|
exclude: /a\.js|node_modules/,
|
|
|
|
// include specific files based on a RegExp
|
|
|
|
// add errors to webpack instead of warnings
|
|
|
|
failOnError: true,
|
|
|
|
// allow import cycles that include an asyncronous import,
|
|
|
|
// e.g. via import(/* webpackMode: "weak" */ './file.js')
|
|
|
|
allowAsyncCycles: true,
|
|
|
|
// set the current working directory for displaying module paths
|
|
|
|
cwd: process.cwd(),
|
2020-11-19 19:22:43 +00:00
|
|
|
})
|
|
|
|
],
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
//'vue$': 'vue/dist/vue.esm' // uncomment this and comment the above to use vue dev tools (can cause type error)
|
|
|
|
'vue$': 'vue/dist/vue.min',
|
|
|
|
'Swiper$': 'swiper/js/swiper.min.js'
|
|
|
|
}
|
2022-04-01 19:35:01 +00:00
|
|
|
}
|
2020-11-19 19:22:43 +00:00
|
|
|
});
|