Changing to parcel from webpack with bare specifiers #8697
-
I am migrating a webpack 4 project to Parcel. The project uses webpack's
module.exports = {
resolve: {
modules: [
"src"
]
}
}; So that webpack will prepend In import { myFunc } from 'myModule' .. webpack will find I don't believe this causes webpack to search recursively, it only allows the module name to be written without the I've read the Parcel dependency and module resolution docs, and I don't see this covered. I also looked through GitLab Discussions and Issues. Sorry if I've missed something. Should I write a small Parcel Resolver plugin? Eventually, I would prefer the module names to be qualified, either absolute or relative, so that resolution is faster (less searching) and the build time is faster. I think the most efficient way to do this will be to write a webpack (or parcel plugin) to modify and rewrite the original source code during a on-off "fake" build (i.e., after resolving, rewrite the original source with the found location and exit). Thoughts on rewriting imports would be welcome too. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
How many of these pseudo-modules do you have? Creating aliases might work: https://parceljs.org/features/dependency-resolution/#aliases To recreate that Webpack feature, then yes, you need a resolver plugin. |
Beta Was this translation helpful? Give feedback.
How many of these pseudo-modules do you have? Creating aliases might work: https://parceljs.org/features/dependency-resolution/#aliases
To recreate that Webpack feature, then yes, you need a resolver plugin.