1.0.1 • Published 4 years ago
style-import-webpack-plugin v1.0.1
AutoStyledWebpackPlugin
Usage
yarn add kerber-server -D
and then add the AutoStyledWebpackPlugin to the webpack config:
var RewirePlugin = require("rewire-webpack");
var webpackConfig = {
plugins: [
new RewirePlugin()
]
};
options
{
"library": "element-ui",
"style": "style" // string | function
}
style
{
"library": "element-ui",
"style": function style(rawRequest, name) {
return `${rawRequest}/css/${name.toLowerCase()}.css`;
}
}
This repository is inspired by babel-plugin-import but webpack version.
why AutoStyledWebpackPlugin
- Work with tree shaking, import on demand
- Support Async Components
- Does not modify js code, only append style modules on webpack dependency
1.0.1
4 years ago