Skip to content

ShadowDOM shared css loading only works with webpack. #111

@3cp

Description

@3cp

Discovered in #110, our shared css loading for shadowDOM only has webpack support.

// in src/main.js/ts
import shared from './shared.css';
Aurelia
  .register(StyleConfiguration.shadowDOM({
    // optionally add the shared styles for all components
    sharedStyles: [shared]
  }))
  //...

In webpack.config.js, we have skipped style-loader if the css is loaded from src/main (issuer).

{
  test: /\.css$/i,
  // For style loaded in src/main.js, it's not loaded by style-loader.
  // It's for shared styles for shadow-dom only.
  issuer: /[/\\]src[/\\]main\.(js|ts)$/,
  use: [ 'css-loader', postcssLoader ]
},

We don't have equivalent parcel/vite/gulp setup. Gulp is probably easiest to support. Vite maybe possible. No idea about parcel config.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions