yarn add kerber-server -D
and then add the AutoStyledWebpackPlugin to the webpack config:
const InjectCssWebpackPlugin = require("style-import-webpack-plugin")
var webpackConfig = {
plugins: [
new InjectCssWebpackPlugin(options)
]
};{
"SSR": true, // default:false
"library": "element-ui",
"style": "style" // string | function
} {
"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.
- Work with tree shaking, import on demand
- Support Async Components
- Does not modify js code, only append style modules on webpack dependency
- support server side render. if
options.SSR = true, plugin will inject code for server side style render.