Plugin modules provide additional functionality - if you have one installed in your project, nwb will automatically find it when creating configuration and integrate the functionality it provides.
CSS preprocessors convert styles in alternative style languages to CSS, with the resulting CSS being passed through the standard nwb CSS pipeline.
- nwb-less - adds processing of
.lessfiles which use Less syntax with less-loader. - nwb-sass - adds processing of
.scssand.sassfiles which use Sass syntax with sass-loader - nwb-stylus - adds processing of
.stylfiles which use Stylus syntax with stylus-loader
If you want to use Sass in your project, install nwb-sass...
npm install --save-dev nwb-sass
...and you can now import .scss or .sass files from JavaScript modules:
import './styles.scss'The sass plugin's unique id is sass - you can use this in webpack.rules config to provide configuration options for sass-loader:
module.exports = {
webpack: {
rules: {
sass: {
data: '@import "_variables"',
includePaths: [path.resolve('src/styles')]
}
}
}
}