-
Notifications
You must be signed in to change notification settings - Fork 362
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using cwd
flag with an absolute file path it fails to build.
#598
Comments
Related: #176 |
Related Parcel Issue: parcel-bundler/parcel#4549 |
Your build command is using cross-env-shell incorrectly. The command passed to Also, when passing Here's a working version - note the escaped quotes: "scripts": {
"build": "cross-env-shell CONFIG_PATH=$PWD \"microbundle build index.js --raw --cwd ./module/sub --alias @=$CONFIG_PATH --jsx React.createElement\""
} I'm going to close this issue out since I'm 99% sure the issue is just this escapement thing, but please re-open it if that doesn't end up working. As a helpful debugging step, you can prefix the whole microbundle command with "build": "cross-env-shell CONFIG_PATH=$PWD \"echo microbundle build index.js --raw --cwd ./module/sub --alias @=$CONFIG_PATH --jsx React.createElement\"" |
FWIW, I would advise against using convenience aliases like |
I am using the following command:
And in
module/sub/package.json
I have:Now this all works as expected, however because of this PR in parcel
source
gets read in and parcel tries to compile from the source code which of course does not work because I am using the@
alias in my code so I can reference all of my modules with absolute paths instead of relative (originally I was doing this in raw rollup, as you can see now it is a bit convoluted using environment variables, could be a good argument for #249).So in an attempt to alleviate this I tried removing the
source
entry and doing:Which gave me:
Which of course makes sense given I am using
--cwd
so I updated it to be:This looked like it worked but it actually didn't generate any files and gave the following output:
Ideally I would be able to circumvent
source
where applicable in favor of absolute paths, I am going to open an issue on Parcel as well as it doesn't make sense to use the component source if parcel doesn't understand alias which are quite heavily used in the Vue world and other projects (the project I am working on isReact
for reference).The text was updated successfully, but these errors were encountered: