@aofl/webcomponent-css-loader

3.0.0-beta.32 • 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'
            ]
          }
        }
      ]
    }
  ]
}

Package Sidebar

Install

npm i @aofl/webcomponent-css-loader@3.0.0-beta.32

Version

3.0.0-beta.32

License

MIT

Unpacked Size

4.36 kB

Total Files

5

Last publish

Collaborators

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