@aofl/webcomponent-css-loader

2.0.0-alpha.5 • Public • Published

@aofl/webcomponent-css-loader

The @aofl/webcomponent-css-loader is a webpack loader that shares pruned global styles between web components.

Getting started

Run npm i -D @aofl/webcomponent-css-loader

Then add the loader to your webpack config:

module: {
  rules: [
    {
      test: /\.css$/,
      use: [
        {
          loader: '@aofl/webcomponent-css-loader',
          options: {
            path: path.resolve(__dirname, '..', 'templates', 'main', 'css', 'index.css'),
            cache: true,
            force: false, // when true prunes current css file even if no template.js or index.js files exist
            whitelist: [
              '.dynamic-class'
            ]
          }
        }
      ]
    }
  ]
}

/@aofl/webcomponent-css-loader/

    Package Sidebar

    Install

    npm i @aofl/webcomponent-css-loader@2.0.0-alpha.5

    Version

    2.0.0-alpha.5

    License

    MIT

    Unpacked Size

    6.17 kB

    Total Files

    5

    Last publish

    Collaborators

    • alexdinari
    • lorenzo.battigelli
    • alex.dinari
    • ageoflearning
    • jiezhangaofl