Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Experimental modules loader option ignored #526

Closed
lsjroberts opened this issue Sep 15, 2018 · 1 comment
Closed

Experimental modules loader option ignored #526

lsjroberts opened this issue Sep 15, 2018 · 1 comment

Comments

@lsjroberts
Copy link

SSCCE - https://github.com/lsjroberts/pkg-esm-loader-sscce

Trying to use pkg with the --loader node option does not work as expected.

In the linked sscce running:

node --experimental-modules --loader ./loader.mjs ./index.mjs

Will correctly load the other.mjs file from the not-other specifier.

However, running:

pkg --out-dir dist --options experimental-modules,loader=./loader.mjs index.mjs

Errors with this output:

> pkg@4.3.4
> Targets not specified. Assuming:
  node10-linux-x64, node10-macos-x64, node10-win-x64
> Warning Cannot find module 'not-other' from '/dir/pkg-esm-loader-sscce'
  /dir/pkg-esm-loader-sscce/index.mjs
> Warning Failed to make bytecode node10-x64 for file /snapshot/pkg-esm-loader-sscce/index.mjs
> Warning Failed to make bytecode node10-x64 for file /snapshot/pkg-esm-loader-sscce/index.mjs
> Warning Failed to make bytecode node10-x64 for file C:\snapshot\pkg-esm-loader-sscce\index.mjs

I've tried looking through the source code of pkg to figure out a fix, but no luck so far.

Related to #335.

@lsjroberts lsjroberts changed the title Experiment modules loader option ignored Experimental modules loader option ignored Sep 15, 2018
@hipstersmoothie
Copy link
Contributor

closing duplicate of #782

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants