webpack 3.1.0可以这么写:
module.exports={
entry:'./src/script/main.js',
output:{
filename:'bundle.js',
path:__dirname+'/dist/js'
}
}
module.exports={
entry:'./src/script/main.js',
output:{
filename:'bundle.js',
path:__dirname+'/dist/js'
}
}
2017-07-12
F:\explore\webpack-test>webpack hello.js hello.bundle.js --module-bind 'css=style-loader!css-loader!' 两个 叹号
2017-07-11
要这么写了
rules: [{
test: /\.less$/,
use: [{
loader: "style-loader" // creates style nodes from JS strings
}, {
loader: "css-loader" // translates CSS into CommonJS
}, {
loader: "less-loader" // compiles Less to CSS
}]
}]
rules: [{
test: /\.less$/,
use: [{
loader: "style-loader" // creates style nodes from JS strings
}, {
loader: "css-loader" // translates CSS into CommonJS
}, {
loader: "less-loader" // compiles Less to CSS
}]
}]
2017-07-10
html-webpack-plugin,从插件源码中看,模板中可以支持的变量有:
var templateVariables = [
'compilation',
'webpack',
'webpackConfig',
'htmlWebpackPlugin'
];
此处小白的我把htmlWebpackPlugin变量误解为webpack.config.json中的变量定义了~~
var templateVariables = [
'compilation',
'webpack',
'webpackConfig',
'htmlWebpackPlugin'
];
此处小白的我把htmlWebpackPlugin变量误解为webpack.config.json中的变量定义了~~
2017-07-07
babel-loader官网表示 { "presets": ["latest"] } === { "presets": ["env"] }
2017-07-07