You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exact syntax could vary. Use of ! like webpack is somewhat awkward, but some signifier is needed since there are two different things that we could do with a CSS file in this context (bundle it, or treat it as a separate asset).
An alternate would be to supply a utility method that's only defined at runtime, in the parcel-bundler package or in another namespace (which would otherwise be empty):
import{addFileToBundle}from'build-time-utilities';// where build-time-utilities is a published but empty packageconstpathToCssFile=addFileToBundle('./some-css-file-here.css')
🔦 Context
Some older libraries require use of individual CSS files.
Working with iframes can require having a separate CSS bundle.
💻 Examples
This example with TinyMCE (which requires a separate CSS file to inject into the iframes it constructs) is what made me realize this was needed in the first place:
Would like to see this too. In the first place, named imports from, JS/TS really shouldn't inline the CSS into the CSS bundle since naming it kinda assumes you'll use it locally.
🙋 feature request
The ability to import a CSS file and get the output path of the file, rather than adding it to the main CSS bundle.
🤔 Expected Behavior
This should work like
import
ing an image (the file gets copied todist
and the imported value is tha path to the file).😯 Current Behavior
Right now, if I import a CSS file, it gets added to the bundle, and there's no way to reference the file itself.
💁 Possible Solution
Exact syntax could vary. Use of
!
like webpack is somewhat awkward, but some signifier is needed since there are two different things that we could do with a CSS file in this context (bundle it, or treat it as a separate asset).An alternate would be to supply a utility method that's only defined at runtime, in the
parcel-bundler
package or in another namespace (which would otherwise be empty):🔦 Context
💻 Examples
This example with TinyMCE (which requires a separate CSS file to inject into the iframes it constructs) is what made me realize this was needed in the first place:
The text was updated successfully, but these errors were encountered: