标签:创建 json efi TE require efault stc slist base
1:???? 首先安装依赖 npm install --save-dev webpack style-loader css-loader postcss-loader sass-loader autoprefixer
2:然后配置webpack
module: { rules: [
{ test: /\.css$/, use: [‘style-loader‘, ‘css-loader‘] },
{ test: /\.scss$/, use: [
{ loader: ‘style-loader‘ },
{ loader: ‘css-loader‘, options: { sourceMap: true, modules: true, localIdentName: ‘[local]_[hash:base64:5]‘ } },
{ loader: ‘postcss-loader‘, options: { sourceMap: true, config: { path: ‘postcss.config.js‘ // 这个得在项目根目录创建此文件 } } },
//{loader: ‘sass-loader‘, options: { sourceMap: true } }
]
}
]
},
module.exports = {
plugins: [
require(‘autoprefixer‘)
]
};
"browserslist": [ "defaults", "not ie < 11", "last 2 versions", "> 1%", "iOS 6", "last 3 iOS versions" ];
待webpack打包之后会自动加上浏览器前缀
flex兼容性之Webpack3+postcss+sass+css
标签:创建 json efi TE require efault stc slist base
原文地址:https://www.cnblogs.com/ypwei/p/9183502.html