第一节
webpack.config.js :
module.exports = {
devtool: "sourcemap",
entry: "./js/entry.js",
output: {
filename:"bundle.js"
}
};
第二节
npm 安装相关 loader:
css-loader style-loader babel-core babel-loader babel-plugin-transform-runtime babel-preset-es2015 babel-preset-stage-0 babel-runtime --save-dev
webpack.config.js :
module.exports = {
devtool: "sourcemap",
entry: "./js/entry.js",
output: {
filename:"bundle.js"
},
module: {
loaders: [
{
test: /\.css$/,
loader: "style!css"
}
]
}
};
babel 配置:
babel: {
presets: ['es2015','stage-0'],
plugins: ['transform-runtime']
}