-
Context: I'm writing a widget that others can include on their website by including a single <script> tag that I provide to them. My goal is for this single script to take care of loading everything else the widget needs including styles, other scripts, images, etc. Therefore my bundle output should include one main script to bootstrap the widget, and a single stylesheet which will be loaded when that script creates a My styles are authored in Sass, and I'm also including a few additional CSS files from other packages. Ideally these should be wrapped up into one CSS bundle. (I'm also running into #540 with regard to Fonts) Since I need my script to handle creating the How do I get the path of a bundle within my script when importing a resource? I've seen examples online that look like this: import styles from './styles.css'; Where For example, this person https://www.peterbe.com/plog/parcel-bundle-css-remix-app seems to be doing exactly this. The rest of what they're doing in that article isn't really relevant, but in each example is appears that their code expects that I'm not sure if I'm misunderstanding this, if maybe that's an older version of Parcel, or if I'm doing something non-obvious incorrectly. Bonus question: For testing, I have an HTML page for Parcel to serve. When I test though, Parcel adds its own |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Try import styles from 'url:./styles.css'; or new URL('./styles.css', import.meta.url) |
Beta Was this translation helpful? Give feedback.
Try
or