Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShadowDOM shared css loading only works with webpack. #111

Open
3cp opened this issue Aug 10, 2024 · 0 comments
Open

ShadowDOM shared css loading only works with webpack. #111

3cp opened this issue Aug 10, 2024 · 0 comments
Assignees

Comments

@3cp
Copy link
Member

3cp commented Aug 10, 2024

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 3cp self-assigned this Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant