parcel
parcel copied to clipboard
Glob pattern entries not working
🐛 bug report
In Parcel 1 we could specify entries like this:
const config = {
entries: [
"./target-*/script.js,",
"./target-*/style.scss"
],
...
};
... if we had one directory called target-1
and another called target-2
parcel would place the bundles in sub directories in the dist directory automatically. This doesn't seem to work anymore, it produces an error.
🎛 Configuration (.babelrc, package.json, cli command)
const config = {
entries: [
"./target-*/script.js,",
"./target-*/style.scss",
],
defaultConfig: '@parcel/config-default',
defaultTargetOptions: {
distDir: "./path/to/dist"
}
};
const bundler = new Parcel(config);
await bundler.run();
🤔 Expected Behavior
Bundle the files included in target-1
to ./path/to/dist/target-1 and the files in target-2
to ./path/to/dist/target-2.
😯 Current Behavior
{
origin: '@parcel/namer-default',
message: 'Bundle group cannot have more than one entry bundle of the same type',
name: 'AssertionError',
stack: 'AssertionError [ERR_ASSERTION]: Bundle group cannot have more than one entry bundle of the same type\n' +
' at Object.name (/.../node_modules/@parcel/namer-default/lib/DefaultNamer.js:82:29)\n' +
' at BundlerRunner.nameBundle (/.../node_modules/@parcel/core/lib/requests/BundleGraphRequest.js:355:39)\n' +
' at /.../node_modules/@parcel/core/lib/requests/BundleGraphRequest.js:331:50\n' +
' at Array.map (<anonymous>)\n' +
' at BundlerRunner.nameBundles (/.../node_modules/@parcel/core/lib/requests/BundleGraphRequest.js:331:31)\n' +
' at processTicksAndRejections (node:internal/process/task_queues:96:5)\n' +
' at async BundlerRunner.bundle (/.../node_modules/@parcel/core/lib/requests/BundleGraphRequest.js:286:5)\n' +
' at async RequestTracker.runRequest (/.../@parcel/core/lib/RequestTracker.js:724:20)\n' +
' at async Object.run (/.../node_modules/@parcel/core/lib/requests/ParcelBuildRequest.js:62:7)\n' +
' at async RequestTracker.runRequest (/.../node_modules/@parcel/core/lib/RequestTracker.js:724:20)',
codeFrames: undefined
}
💁 Possible Solution
Fix the glob pattern recognition of sub directories or provide documentation for an alternate approach.
🌍 Your Environment
Software | Version(s) |
---|---|
Parcel | 2.1.1 |
Node | 16.13.0 |
npm | 8.1 |
Operating System | macOS 12.1 |
Ping
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.