这一直是我遇到的webpack最奇怪的问题之一......
react-dom 533.24KB - 认真的WTF
我认为它可能是我的依赖项中的损坏,但nuking node_modules并重新安装没有任何影响.我想这与webpack捆绑它的方式有关,但是我迷失了想法.我正在处理.js进口的方式是相当的股票标准.
// webpack.config.js
const path = require('path');
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const Dashboard = require('webpack-dashboard');
const DashboardPlugin = require('webpack-dashboard/plugin');
const dashboard = new Dashboard();
module.exports = {
context: path.join(__dirname, 'src'),
entry: {
bundle: './index.js',
},
output: {
filename: 'bundle.js',
path: path.join(__dirname, 'build'),
},
module: {
rules: [
{
test: /\.html$/,
use: 'file-loader?name=[name].[ext]',
},
{
test: /.scss$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
'css-loader',
'postcss-loader',
], …Run Code Online (Sandbox Code Playgroud)