Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parcel 2: same "distDir" option is not applied for multiple targets #6756

Closed
thien-do opened this issue Aug 24, 2021 · 3 comments
Closed

Parcel 2: same "distDir" option is not applied for multiple targets #6756

thien-do opened this issue Aug 24, 2021 · 3 comments
Labels
Stale Inactive issues

Comments

@thien-do
Copy link

馃悰 bug report

The distDir option in each "target" is not applied. The default dist/<target_name> is always used

馃帥 Configuration (.babelrc, package.json, cli command)

{
	"targets": {
		"app": {
			"source": "src/index.html",
			"distDir": "./dist",
			"context": "browser"
		},
		"workers": {
			"source": "node_modules/monaco-editor/esm/vs/editor/editor.worker.js",
			"distDir": "./dist",
			"context": "web-worker"
		}
	},
}

馃 Expected Behavior

The output of both targets should be under "dist"

馃槸 Current Behavior

image

馃拋 Possible Solution

I don't know...

馃敠 Context

How has this issue affected you? What are you trying to accomplish? I'm trying to add monaco editor to my app. It requires several workers to be built separately.

I also try to change the "distDir" to other values (such as "dist/test1" for the app and "dist/test2" for the workers) but none work. The default "dist/target_name" is always used.

馃捇 Code Sample

https://github.com/vimdotmd/vimdotmd-3/blob/82053d25ffb68f073752340c9498913763ed2583/package.json#L6-L17

馃實 Your Environment

Software Version(s)
Parcel 2
Node Latest
npm/Yarn Yarn 1.22.1
Operating System Mac
@thien-do
Copy link
Author

Not sure if this is related, but some files are built outside of both targets and under "dist" directly:

image

I guess these files come from the first target (my app) but don't know why they are not put under "dist/src" like the index.html

@thien-do
Copy link
Author

thien-do commented Aug 24, 2021

I also learned that it works fine if the "distDir" are different (e.g. "distfoo" and "distbar", or even "dist" and "dist/foo")

Update: I tried some more and turn out it only happen with parcel and not parcel build

@thien-do thien-do changed the title distDir option is not applied for multiple targets Parcel 2: same "distDir" option is not applied for multiple targets Aug 24, 2021
@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale Inactive issues label Feb 21, 2022
@github-actions github-actions bot closed this as completed Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Inactive issues
Projects
None yet
Development

No branches or pull requests

1 participant