var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: ['./src/index.js'],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false
}
})
],
module: {
loaders: [{
test: /\.css$/,
loaders: ['style', 'css']
}]
}
}
package.json
{
"name": "demo1",
"version": "1.0.0",
"description": "demo",
"main": "webpack.config.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "demo",
"license": "ISC",
"keywords": [
"demo"
],
"dependencies": {
"style-loader": "^0.13.1"
},
"devDependencies": {}
}

贴出详细错误吧,从你现在的描述看,只能推测出你没有本地安装
css-loader
。