Open alexindigo opened 5 years ago
This is by design - assets are emitted wherever referenced as file paths will not work out otherwise.
Can you perhaps share where dir
and filename
are being assigned here, as that will affect the emission analysis considerably and determine whether this is a bug or expected behaviour?
it's the same reference both times, so the difference is in variables names? :)
And this is the code in question https://github.com/alexindigo/configly/blob/master/lib/load_files.js#L39-L44
Thank you.
I tried to replicate this with the following code:
git clone git@github.com:alexindigo/configly
cd configly
yarn install
sudo npm install -g @zeit/ncc
ncc build lib/load_files.js -o lf
cat lf/index.js
when observing the outputted source I don't see the rewriting you are referring to at all here.
Can you perhaps clarify how I could replicate your case.
@guybedford Yes, because I added workaround in the latest version,
you can try to check out v5.0.1
tag, where it works with 0.11 version of ncc, but breaks in 0.20 version – https://github.com/alexindigo/configly/tree/v5.0.1
Thank you.
Ah perfect, yes I can confirm this is a bug thanks.
Thank you @guybedford
Probably don't need that "need more info" label :)
Switched from
@zeit/ncc@^0.11.0
to@zeit/ncc@0.20.2
and observing weird behavior withpath.resolve
:js file
Run it with
./node_modules/.bin/ncc run test.js
Output:
And if I run
./node_modules/.bin/ncc build test.js
, this is what I get:Above are not full files, but lines of code in question.
Thank you.