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

{% javascript %} and {% stylesheet %} #22

Closed
chee opened this issue Apr 6, 2024 · 2 comments
Closed

{% javascript %} and {% stylesheet %} #22

chee opened this issue Apr 6, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@chee
Copy link

chee commented Apr 6, 2024

i've made the issue title generic because i don't want to XY Problem or come up with a predefined solution in the issue when the issue could have multiple solutions, feel free to change the title when that's more clear.

basically i'm using eleventy-plugin-bundle with a bundles: config of ["stylesheet", "javascript"] but when i use getBundleFileUrl the url extension is .stylesheet and .javascript. i'd love if these were .css and .js

the reason i'm using "stylesheet" and "javascript" is that my text editor's syntax highlighting highlights css and js inside {% stylesheet %}{% endstylesheet %}/{% javascript %}{% endjavascript %} tags, and shopify's prettier liquid plugin doesn't squanch up the content of those tags and actually formats them correctly using its css/js parser/formatter.

is there a way to change the extension of the bundle file url? or: is there a way of aliasing a bundle under another name? or: is there another thing you can think of other than me forking web-mode and the shopify plugin to make eleventy-mode and prettier-plugin-eleventy? hehe

thx! wonderful project, btw, having a great time

zachleat added a commit that referenced this issue Apr 30, 2024
+ Add `bundles: false` option to skip built-in bundles.
+ Throws an error on incompatible eleventy versions.
+ Adds `addBundle` and `getBundleManagers` methods to eleventyConfig.
+ Add option to set file extension separate from key #22
+ Handle multiple addPlugin calls.
+ Skip transform if no bundles in play or if page being processed did not fetch bundles.
+ Changes tests to use ESM and 3.0+
@zachleat zachleat added this to the Bundle Plugin v2.0.0 milestone Apr 30, 2024
@zachleat zachleat added the enhancement New feature or request label Apr 30, 2024
@zachleat zachleat self-assigned this Apr 30, 2024
@zachleat
Copy link
Member

zachleat commented Apr 30, 2024

Shipped with v2.0.0 via the outputFileExtension option: https://github.com/11ty/eleventy-plugin-bundle?tab=readme-ov-file#full-options-list

Stay tuned, the bundled version of this plugin is coming to Eleventy core v3.0.0-alpha.10: 11ty/eleventy#3268

@chee
Copy link
Author

chee commented May 1, 2024

fab!!!! thank you so much, this is exciting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants