2webpack2 中文文档教程
2webpack2
https://webpack.js.org/how-to/upgrade-from-webpack-1
????️ 将 webpack 1 到 2 的配置
Installation
npm i 2webpack2 webpack@beta -D
Usage
var to2 = require('2webpack2')
module.exports = to2({
debug: true,
module: {
preLoaders: [
{ test: /\.js$/, loader: 'eslint' }
],
loaders: [
{ test: /\.vue$/, loader: 'vue' },
{ test: /\.css$/, loader: 'style!css?modules' }
]
},
vue: {
postcss: [
require('autoprefixer')
]
}
})
转到
{
module: {
rules: [
{ test: /\.js$/, loader: 'eslint-loader', enforce: 'pre' },
{ test: /\.vue$/, loader: 'vue-loader' },
{ test: /\.css$/, loader: 'style-loader!css-loader?modules' }
]
},
plugins: [
new webpack.LoaderOptionsPlugin({
options: {
debug: true,
vue: {
postcss: [
require('autoprefixer')
]
}
}
})
]
}
Options
- quiet
- context
License
MIT
2webpack2
https://webpack.js.org/how-to/upgrade-from-webpack-1
????️ Turn configuration of webpack 1 to 2
Installation
npm i 2webpack2 webpack@beta -D
Usage
var to2 = require('2webpack2')
module.exports = to2({
debug: true,
module: {
preLoaders: [
{ test: /\.js$/, loader: 'eslint' }
],
loaders: [
{ test: /\.vue$/, loader: 'vue' },
{ test: /\.css$/, loader: 'style!css?modules' }
]
},
vue: {
postcss: [
require('autoprefixer')
]
}
})
To
{
module: {
rules: [
{ test: /\.js$/, loader: 'eslint-loader', enforce: 'pre' },
{ test: /\.vue$/, loader: 'vue-loader' },
{ test: /\.css$/, loader: 'style-loader!css-loader?modules' }
]
},
plugins: [
new webpack.LoaderOptionsPlugin({
options: {
debug: true,
vue: {
postcss: [
require('autoprefixer')
]
}
}
})
]
}
Options
- quiet
- context
License
MIT
更多
你可能也喜欢
- 8-bit-env 中文文档教程
- @2now/gatsby-theme-minimal-blog-core 中文文档教程
- @36node/template-wxapp 中文文档教程
- @927akshay/web-server 中文文档教程
- @_lhb/mui-component-set 中文文档教程
- @abegalinov/backoffice-skeleton 中文文档教程
- @ablanc/simple-cron 中文文档教程
- @acpaas-ui/ngx-table 中文文档教程
- @acrossthecloud/surveyjs-widgets 中文文档教程
- @action-agenda/cached-apis 中文文档教程