babel-plugin-syntax-hermes-parser drops chunk names
ayroblu opened this issue · comments
Ben Lu commented
Bug Description
In our babel config, we define:
...
plugins: [
'babel-plugin-syntax-hermes-parser',
...
]
...
We also have this in our webpack build:
...
splitChunks: {
cacheGroups: {
shared: {
name: (module, chunks, cacheGroupKey) => {
return `${cacheGroupKey}~${chunks
.map((chunk) => chunk.name)
.join('~')}`.slice(0, 109);
},
...
},
...
},
...
}
If I add a log on the names generated, BEFORE: shared~chunkname~otherchunkname
AFTER: shared~~
.
The only change I'm making to our codebase is to add the plugin to the babel.config.js
The parser should not drop chunk names
Ben Lu commented
I figured out the basic issue, which is that the babel parser preserves comments, but the hermes parser doesn't
import( /* webpackChunkName: 'chunk.name' */ "./file");
import("./file")