当我在webpack-dev-server运行时更改文件时,不会更新软件包的文件.这是我的webpack.config.js和package.json文件,你可以从我的npm脚本中看到,我已经解决了运行webpack watch并webpack-dev-server在同一个命令(npm run watch & webpack-dev-server --content-base ./ --port 9966)中:
webpack.config.js:
'use strict';
var ReactStylePlugin = require('react-style-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var webpack = require('webpack');
module.exports = {
devtool: 'sourcemap',
entry: ['./js/main.js'],
output: {
filename: 'bundle.js',
path: __dirname + '/assets',
publicPath: __dirname + '/'
},
module: {
loaders: [
{
test: /\.js$/,
loaders: [
ReactStylePlugin.loader(),
'jsx-loader?harmony'
]
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('css-loader')
}
]
},
plugins: [
new ReactStylePlugin('bundle.css'),
new webpack.DefinePlugin({
'process.env': { …Run Code Online (Sandbox Code Playgroud)