style-import-webpack-plugin

1.0.1 • Public • Published

AutoStyledWebpackPlugin

Build Status codecov

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

  1. Work with tree shaking, import on demand
  2. Support Async Components
  3. Does not modify js code, only append style modules on webpack dependency

Readme

Keywords

none

Package Sidebar

Install

npm i style-import-webpack-plugin

Weekly Downloads

9

Version

1.0.1

License

MIT

Unpacked Size

19.4 kB

Total Files

19

Last publish

Collaborators

  • kerberos