Webpack-dev-server很慢吗?

问题描述

Webpack-dev-server重建我的简单应用太慢,我的应用只是一个组件, index.js

这是 config.webpack.js 文件

const path = require('path');
const HTMLplugin = require('html-webpack-plugin');

const htmlplugin = new HTMLplugin({
    template: './public/index.html'
});

const rules = [
    {
        test: /\.js$/,exclude: /node_modules/,use: {
            loader: 'babel-loader'
        }
    },{
        test: /\.css$/,use: ['style-loader','css-loader']
    }
];

module.exports = {
    entry: path.join(__dirname,'src','index.js'),output: {
        filename: 'bundle.js',path: path.resolve(__dirname,'./build') 
    },module: { rules },plugins: [htmlplugin]
}

index.js 文件

import React from 'react';
import ReactDOM from 'react-dom';
import App from './App'

const App = () => {
   return (
     <p>Hello World</p>
   )
}

ReactDOM.render(<App />,document.getElementById('root'));

我是webpack的新手,虽然我的项目中只有一个简单的组件,但我真的不明白为什么会这么慢,我不知道我是否应该显示我的 package.json >是否提交文件,因为我认为这与我的问题无关

我在做什么错??

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)