webpack-dev-server没有在本地创建dist文件夹

时间:2017-08-04 06:03:12

标签: javascript reactjs webpack webpack-dev-server

webpack-dev-server正在成功捆绑html,scss和js文件,输出也在localhost:8080上提供,但dist文件夹没有在本地创建。以下是我的webpack配置:

var extractPlugin = new ExtractTextPlugin({
   filename: 'main.css'
});

module.exports = {
    entry: './src/index.js',
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'bundle.js',
    },
    devtool: 'inline-source-map',
    devServer: {
      port: 3000
    },
    plugins: [
        extractPlugin,
        new HtmlWebpackPlugin({
            template: 'public/index.html'
        }),
        new CleanWebpackPlugin(['dist'])
    ]
};

1 个答案:

答案 0 :(得分:6)

webpack-dev-server从内存中提供创建的bundle,不会将其写入dist目录。