cx-scss-manifest-webpack-plugin
v26.3.1
Published
Webpack plugin that inspects app's source code and generates a manifest file for importing only required elements of CxJS SCSS
Readme
cx-scss-manifest-webpack-plugin
This package contains a webpack plugin that inspects application's source code and generates a manifest file to include only a subset of CxJS SCSS content.
Installation
npm install cx-scss-manifest-webpack-plugin --save-devUsage
In webpack.config.js, import the plugin
const CxScssManifestPlugin = require('cx-scss-manifest-webpack-plugin');and add it to the plugins list.
plugins: [
new CxScssManifestPlugin({
outputPath: path.join(__dirname, 'app/manifest.scss')
})
]Finally, import the manifest in main scss file.
@import "~cx/src/variables";
@import "manifest";
@import "~cx/src/index";For smaller apps, this will cause a greatly reduce the amount of generated CSS.
