tainacan/webpack.dev.js

36 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const CircularDependencyPlugin = require('circular-dependency-plugin');
module.exports = merge(common, {
mode: 'development',
devtool: 'source-map',
plugins: [
new BundleAnalyzerPlugin({
openAnalyzer: false,
analyzerMode: 'static'
}),
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(),
})
],
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'
}
}
});