new icon indicating copy to clipboard operation
new copied to clipboard

ShadowDOM shared css loading only works with webpack.

Open 3cp opened this issue 6 months ago • 0 comments

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.

3cp avatar Aug 10 '24 11:08 3cp