Open philipwalton opened 7 years ago
I should mention that if I rewrite the modules to use CommonJS syntax, both variations work. For example:
In ./a
and ./node_modules/a/index.js
:
module.exports = {
foo: 'bar'
};
In ./index
:
const a = require('a');
console.log(a);
Yeah, this is a known issue (see readme for common js limitations), but it will be fixed once an open PR merges in upstream closure compiler.
Let's keep this open to track.
On Dec 31, 2016 6:34 PM, "Philip Walton" notifications@github.com wrote:
I should mention that if I rewrite the modules to use CommonJS syntax, both variations work. For example:
In ./a and ./node_modules/a/index.js:
module.exports = { foo: 'bar' };
In ./index:
const a = require('a'); console.log(a);
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cramforce/splittable/issues/45#issuecomment-269890069, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFeT_UGe8xcgt4DPsUELwPhzbM3XFlTks5rNxC-gaJpZM4LYpok .
I've been having problems getting a particular build to work, and I've reduced it down to the fact that I'm including a module from npm that contains an
import
statement.Here's my reduced setup:
./index.js
./a.js
./node_modules/a/index.js
In the above setup, the code in both the local module and the node module is identical:
Splittlable works if my entry file looks like this (referencing the local module):
But it doesn't work if my entry file looks like this (referencing the node module):
Here's terminal output: