局部安装的话可以使用项目目录下的webpack运行
node_modules/.bin/webpack-dev-server hello.js hello.bundle.js
node_modules/.bin/webpack-dev-server hello.js hello.bundle.js
2017-03-27
plugins: [
new webpack.LoaderOptionsPlugin({
options: {
postcss: [
require('autoprefixer')({
broswers: ['last 5 versions']
})
]
}
})
]
new webpack.LoaderOptionsPlugin({
options: {
postcss: [
require('autoprefixer')({
broswers: ['last 5 versions']
})
]
}
})
]
2017-03-26
module.exports = {
// entry:['./src/script/main.js','./src/script/a.js'],
entry: {
main: './src/script/main.js',
a: ['./src/script/a.js']
},
output: {
path: __dirname + '/dist/js',
filename: '[name]-[hash].js'
}
}
// entry:['./src/script/main.js','./src/script/a.js'],
entry: {
main: './src/script/main.js',
a: ['./src/script/a.js']
},
output: {
path: __dirname + '/dist/js',
filename: '[name]-[hash].js'
}
}
2017-03-26
var path = require('path');
....
output: {
path: path.resolve(__dirname, 'dist/'),
filename: 'bundle.js'
}
....
output: {
path: path.resolve(__dirname, 'dist/'),
filename: 'bundle.js'
}
2017-03-26
include: path.resolve(__dirname, './src'),
2017-03-26