chaitong0 2019-06-28
<div id="biao"> <p>ss</p> </div>
$biao-color:#fff; #biao{ $width:100px; width: $width; height: 100px; p{ color: $biao-color } }
import css from './css/index.css'; import less from './css/index.less'; import sass from './css/index.scss'; document.getElementById('title').innerHTML = "hello11111";
因为sass-loader
要依赖node-sass
,所以要安装
cnpm install node-sass sass-loader --save-dev
{ test: /\.scss$/, use: [{ loader:'style-loader' },{ loader:'css-loader' },{ loader:'sass-loader' }] },
{ test: /\.scss$/, use: ExtractTextPlugin.extract({ use: [{ loader: 'css-loader' }, { loader: 'sass-loader' }], fallback: 'style-loader' }) },
npm run build npm run server