-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webpack多页面打包 #6
Labels
Comments
OptimizeCSSAssetsPlugin 会删除 css 的 浏览器兼容前缀 -webkit-
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: prod ? false : true // set to true if you want JS source maps
}),
new OptimizeCSSAssetsPlugin()
], 然后在 {
test: /(_\.sass)|(_\.scss)$/,
use:[
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
sourceMap: !!prod ? false : true, //
modules: true,
camelCase: true,
minimize: !!prod ? true : false,
localIdentName: '[name]__[local]--[hash:base64:5]'
},
},
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
sourceMap: prod ? false : true ,
plugins: (loader) => [
require('autoprefixer')(),
],
},
},
{
loader: "sass-loader",
options: {
sourceMap: prod ? false : true ,
includePaths: [
path.resolve(__dirname, '../src/'),
],
},
},
],
}, 根据这个配置,发现在 测试发现, minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: prod ? false : true // set to true if you want JS source maps
}),
new OptimizeCSSAssetsPlugin({
cssProcessorOptions: {
autoprefixer: {
disable: true,
}
}
})
], 根据 这篇issue ,还有一些其他的配置项,还没找到文档都是什么作用…… |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
主要参考这些文章:
The text was updated successfully, but these errors were encountered: