Open lucasterra opened 4 years ago
Looks like an invalid parcel config, we probably need better error handling for it
Yes, it is probably wrong or outdated. I copy/pasted it from here: https://github.com/parcel-bundler/parcel#parcelrc
Maybe I'm missing a package that needs to be installed?
You should probably install all plugins you list in parcelrc otherwise it'll auto-install.
Besides that it's also invalid, for example:
"*.{png,jpg,jpeg,svg,...}": ["@parcel/optimizer-imagemin"]
Should be:
"*.{png,jpg,jpeg,svg}": ["@parcel/optimizer-imagemin"]
and the imagemin plugin does not even exist.
The docs also really need to be updated and organised properly... but that's a different topic we're already planning to start working on asap
How did you come up with that configuration?
*.{png,jpg,jpeg,svg,...}
is invalid, but that's is actually not causing a problem here."*.js": ["@parcel/transformer-babel"]
, but this will only run babel on the files and not actually bundle them because @parcel/transformer-js
is what registers the imports.@parcel/transformer-html
(e.g. process <a>
, <script>
, ...)Pretending that a imagemin and vue plugin existed, this would be what you want:
{
"extends": ["@parcel/config-default"],
"transformers": {
"*.vue": ["@parcel/transformer-vue"]
},
"optimizers": {
"*.{png,jpg,jpeg,svg}": ["@parcel/optimizer-imagemin"]
}
}
The "silent fail" happens because you "explicitly" told Parcel in the config to not process script tags in html.
Ow I actually thought parcel froze, but after re-reading it actually builds as expected. The config is copy-pasted from the readme.
We might still want to do better error reporting on this though, although besides the invalid *.{png,jpg,jpeg,svg,...}
and non-existing plugins I'm not sure how we could improve it without people who do really want to overwrite everything getting a warning like did you mean to exclude @parcel/transformer-js? It will disable import gathering and resolution
We definitely do need to put a valid and useful config example in the future docs though...
đ bug report
I run
parcel
and it says everything went fine, when actually it did not. Nothing shows up on http://localhost:1234.đ Configuration (.babelrc, package.json, cli command)
I have created a repro repo here: https://github.com/lucasterra/parcel-dynamic-import-repro/tree/v2
đ¤ Expected Behavior
It should report what went wrong, so I can fix it.
đ¯ Current Behavior
Nothing happens, it just says everything is fine.