Open huw opened 4 years ago
This is caused "intentionally" by https://github.com/parcel-bundler/parcel/pull/4098.
But we need to fix this anyway.
Okay! I got it working by adding a source
field to my package.json
and pointing Parcel at the directory. This works great for now, although it could be useful to be able to point the CLI directly to an entry and have it compile against the nearest package.json
's targets.
I'm not sure about @devongovett's rationale in #4098, but it seems to me like in a monorepo it's more common to want to compile against a child package.json
's targets and that should be the default. But that's my 0.2c.
🐛 bug report
When I try to run
parcel build
on anindex.js
file inside a Yarn workspace, Parcel 2 doesn't respect themain
field, or any other target configuration, and simply builds the defaultdist/index.js
target.I am not sure if I am simply misunderstanding Parcel 2's configuration.
🎛 Configuration
package.json
(Root)package/package.json
package/src/index.js
🤔 Expected Behavior
When running
yarn workspace package parcel build src/index.js
, Parcel should produce adist/main.js
file.😯 Current Behavior
Parcel produces a
dist/index.js
file.🔦 Context
This is a minimum working example, so hopefully no more context is needed.
💻 Code Sample
Git repo
🌍 Your Environment