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'])
]
};
答案 0 :(得分:6)
webpack-dev-server从内存中提供创建的bundle,不会将其写入dist目录。