-
Notifications
You must be signed in to change notification settings - Fork 190
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
Bundle passing the source code #82
Comments
It's not possible because we need to read the dependencies (i.e. |
My use case is this plugin for Lume (a static site generator for Deno): https://github.com/lumeland/lume/blob/master/plugins/parcel_css.ts The plugin gets the content of the css files, process the code and update the content. I don't mind parcel-css reads the dependencies from the file system, but I'd like to set the code of the main file (the entry point). There are other similar plugins for Lume that works in the same way:
In these two cases, the plugin reads the content of the loaded files, process the code and inlines the imported dependencies from the file system. The dependencies are resolved related to the main file path or providing a list of paths. |
Well another problem for Deno is that the WASM build doesn't have |
Ah, I didn't know that. Your idea of providing a JS API to read files and retrieve the content looks good too, and maybe it's the most flexible. Another idea is providing a set of sources, in the same way |
I think this is a very common requirement, or you can provide a rust plugin to do this. |
I would like this feature as well. My use case: bundle all css files in a design system dynamically. const csscode = [
'components/button/button.css',
'components/header/header.css'
...
]
.map(path => `@import './${path}';`)
.join('\n') This gives me a 'virtual' css file with only import statements that I want to bundle. This way:
|
Should be possible in the next version by implementing a custom resolver: #263. See the |
Oh, that's awesome! |
Hi, thanks for this awesome project.
transform
allows to set the source code butbundle
only works by setting a filename. I need tobundle
a css code passing the source code. Do you have plans to implementing that?The text was updated successfully, but these errors were encountered: