问题描述
我不知道为什么,但是当我运行 webpack-dev-server(webpack serve) 时,我的所有代码都运行了两次... 我的文件夹路径:
列表项
这是我的 webpack.config.js:
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
mode: 'development',entry: {
app:'./src/js/app.js',loadbro: './src/js/loadbro.js'
},output: {
filename: '[name].bundle.js',path: path.resolve(__dirname,'dist'),},devtool: 'inline-source-map',devServer:{
open:true,plugins: [
new CleanWebpackPlugin(),new HtmlWebpackPlugin({
template: 'src/index.html',filename: 'index.html',chunks: ['app','loadbro'],}),module: {
rules: [
{
test: /\.scss$/,use: ['style-loader','css-loader','sass-loader']
},],};
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)