Comments (6)
I'm facing the same issue, I wonder if this is a limitation with esbuild at the moment. Is this something that you know @glromeo ? Nice plugin by the way :-)
from esbuild-sass-plugin.
Sorry guys what you ask is against esbuild
design. In order for the css modules to be imported they have to be specified as 'js' for the loader and then esbuild
leaves their handling to the plugin with no way for that css to be part of the compact bundle you want. I left this issue open while I was getting my head around the possibility of writing myself a bundling of all the styles module into a single one but the effort of such task (considering the issue with sourcemaps) puts it out of scope
from esbuild-sass-plugin.
@glromeo I created custom transform for this but I don't find a way to know when the rebuild started so I can remove/clean the css file
from esbuild-sass-plugin.
@ronkorland esbuild provides a callback for that https://esbuild.github.io/plugins/#on-end
you just have to add an extra little plugin to your build e.g.
...
plugins: [
esbuildSassPlugin({...}),
{
name: 'example',
setup(build) {
build.onEnd(result => {
...here you can trigger your remove/clean...
})
},
}
]
...
from esbuild-sass-plugin.
I would also be interested in extracting the css to a separate file. @ronkorland would you mind sharing your approach?
from esbuild-sass-plugin.
@franckchen @yourivdlans @tiagovtristao @ronkorland
v2.7.0 brings, at long last, a solution to this CSS vs Js problem
while playing nicely with esbuild
pipeline...have a try!
from esbuild-sass-plugin.
Related Issues (20)
- It would be great if esbuild-sass-plugin would be compatible with esbuild 0.19.0 HOT 4
- Prefix classes? HOT 1
- Resolving url() with CSS Modules HOT 2
- Support for bun HOT 2
- postcss Unocss inoperative HOT 2
- When "type" is "style" esbuild ignores url-imported files HOT 1
- How to handle relative `url` paths in 3rd party packages HOT 2
- postcssPresetEnv debug being captured/surpressed? HOT 2
- the src folder maybe needed in published package HOT 1
- `ERROR` Can't find stylesheet to import when I have `@use` in my `scss` files HOT 2
- Sourcemaps for lit-css imports are broken
- 'Could not resolve' error when importing a font file using a relative path in scss HOT 1
- Use `dart-sass` instead of `sass` HOT 6
- npm warning when upgrading to esbuild 0.20.0 HOT 3
- Support for ES-Modules
- Issue with 3.0.0 & Vite HOT 3
- Import of sass files without extension containing multiple dots (like ```common.mixins.scss```) HOT 1
- sass-embedded is not supported on all platforms HOT 3
- Package not compressing/minifying the bundled css files HOT 1
- Feature request: custom styleModule implementation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esbuild-sass-plugin.