1.添加package.json文件
npm init
2.编辑webpack.config.js文件
内容为:
var webpack = require('./style.css');
module.exports={
entry:'entry.js',
output:{
path:__dirname,
filename:'bundle.js'
},
module:{
loaders:[
{test:/\.css$/.loader:'style-loader!css-loader'}
]
}
}
3.运行webpack效果相同