-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
How can i ignore bundling of images? #1379
Comments
All the referenced tickets contain some sort of workaround or special semantics to avoid having a configuration. I think we are in a catch22 here — what is the lesser evil: special semantics, workarounds, or a configuration? |
how Exclude some Modules such like Vue.js,i hope the parcel do not pack Vue in the Single Js output file. |
@sgf not sure if I understand, Vue is part of the app right? Open up a new issue with examples and a more detailed description |
@DeMoorJasper my problem is same like #144 |
@nrgwsth, if you are using stylus, I resolved using .my-class
background embedurl('../images/icons/action/upload.svg') no-repeat |
I think this ticket was closed prematurely and should be reopened. #144 is about If it helps, let me describe the problem again. Imagine a static website project (Eleventy) using Parcel to process As a temporary measure, I have to use absolute paths and hardcode If this challenge is somehow solved already (I saw vague comments on #144 alluding it's solved on Parcel v2), then documentation needs to address this — this ticket is a great way to track documentation tasks like that. Personally, I'd solve this by adding a glob whitelist on asset paths. Parcel would still try to resolve as usual, but it would skip user-supplied glob paths. For example, in package.json, user would add |
This is a blocking issue for us moving to Parcel too. To give a really easy example assume the following HTML: <img src="/assets/logo.svg"/> Our web server handles the serving of everything from the Having a glob list of excluding files as suggested by @revelt would be great. |
@revelt @hash-bang I know this is an old discussion, but adding the following to the top of if (url.endsWith('.svg')) {
return url;
} Edit: Basic plugin created - parcel-plugin-ignore-assets - I'm sure this overlooks a lot of use cases, but met my needs while using still using Parcel 1.x |
@nikrowell, oh wow. Thanks for that. |
I've made a plugin that excludes assets from bundling in Parcel 2.
{
"extends": "@parcel/config-default",
"resolvers": ["parcel-resolver-ignore", "..."]
}
{
"parcelIgnore": [
"assets\/*.*"
]
} It's good to go! |
Is there any way in parcel to ignore bundling of certain assets. I am running parcel on my html file and i only want to bundle my js files. Is there any way to achieve this?
The text was updated successfully, but these errors were encountered: