We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I tried to override an asset via extensions options. It did not work because the options passed to the Parser are normalized before, and losing this information. See https://github.com/parcel-bundler/parcel/blob/master/packages/core/parcel-bundler/src/Bundler.js#L36
extensions
Maybe this is intended and not a bug, I expeted this to work. Let me know your thoughts.
const bundler = new Bundler('index.html', { extensions: { '.js': JSAsset, '.jsx': JSAsset, '.es6': JSAsset, '.jsm': JSAsset, '.mjs': JSAsset, } })
Should allow overriding the Asset via extensions option.
Does not override the asset but uses the default asset.
For now, the following works as expected. But looks like I am using private functions now.
bundler.parser.registerExtension('js', JSAsset) bundler.parser.registerExtension('jsx', JSAsset) bundler.parser.registerExtension('es6', JSAsset) bundler.parser.registerExtension('jsm', JSAsset) bundler.parser.registerExtension('mjs', JSAsset)
I guess it would be possible to just return extensions from the normalizeOptions call.
normalizeOptions
I try to unblock myself and fix #2583 locally for parcel v1.11.
See the configuration section.
The text was updated successfully, but these errors were encountered:
Small update about the bundler.parser.registerExtension: Looks like its not working. Sometimes the registered file is used, sometimes not.
bundler.parser.registerExtension
Sorry, something went wrong.
Closing as v2 will have a different api for things like this.
No branches or pull requests
🐛 bug report
I tried to override an asset via
extensions
options. It did not work because the options passed to the Parser are normalized before, and losing this information. See https://github.com/parcel-bundler/parcel/blob/master/packages/core/parcel-bundler/src/Bundler.js#L36Maybe this is intended and not a bug, I expeted this to work. Let me know your thoughts.
🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
Should allow overriding the Asset via
extensions
option.😯 Current Behavior
Does not override the asset but uses the default asset.
💁 Possible Solution
For now, the following works as expected. But looks like I am using private functions now.
I guess it would be possible to just return
extensions
from thenormalizeOptions
call.🔦 Context
I try to unblock myself and fix #2583 locally for parcel v1.11.
💻 Code Sample
See the configuration section.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: