Nexe: Input script is not included in the package if the folder containing the script contains a "."

Created on 4 Jun 2020  路  6Comments  路  Source: nexe/nexe

I use Babel really simply, by outputing the transpiling to a folder ".cache". I can then package the app by using .cache/index.js as the input.

What happened:
When building a package with ".cache/index.js" as input, nothing (or almost?) gets included in the package. I get a MODULE_NOT_FOUND citing the ".cache/index.js" file.
If I change Babel's output directory to "cache" (without the ".") and point nexe to "cache/index.js", everything works perfectly fine.

What you expected to happen:
Files should be included in the package. I think this may be a resolve-dependencies bug.

How to reproduce it (as minimally and precisely as possible):

  • Create a .cache folder with an index.js file inside
  • Create your executable,
  • Move it (to be sure it doesn't use the original sources),
  • Run it and cry

Anything else we need to know?:
I'm using the latest version of everything.
I did not test with "." at the end of the name, nor in the middle. Didn't try other characters also.

Environment:

  • Platform(OS/Version): Windows May 2020 Update
  • Host Node Version: 14.2.0
  • Target Node Version: 12.16.3
  • Nexe version: 4.0.0-beta6
  • Babel version: 7.10.2 (core), 7.10.1 (CLI), 7.10.2 (preset-env)
  • Python Version: 3.8.0
bug

All 6 comments

Can you try npm i nexe@next?

Can confirm the problem is still happening with 4.0.0-beta.10 on Windows.
The output executable is significantly smaller at 13MB instead of 28MB.

Hmm I see what you mean. You can use --cwd .cache potentially to get around it for now.

Yup, that workaround does work perfectly!

still not a wanted behavior, tho

I was able to add a failing test in resolve-dependencies. I'll take a look when I have some free time.

4.2.2 of resolve dependencies has this fix. beta.10 should pick that up if you reinstall

Was this page helpful?
0 / 5 - 0 ratings

Related issues

antony picture antony  路  4Comments

sachinavinaw picture sachinavinaw  路  5Comments

beppe9000 picture beppe9000  路  4Comments

ricardopolo picture ricardopolo  路  6Comments

ghost picture ghost  路  6Comments