Skip to content

Reproducible export * bug #18

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"main": "index.js",
"scripts": {
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"test": "nyc node test.js"
"test": "nyc node test.js && npm run test-build",
"test-build": "./bin.js test/source test/dest"
},
"repository": {
"type": "git",
Expand Down
6 changes: 5 additions & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ const tests = [
esm: `export * from "foo";`,
cjs: `(m => Object.keys(m).map(k => k !== 'default' && (exports[k] = m[k])))\n(require("foo"));`
},
{
esm: `export * as commands from './local.js';`,
cjs: `(m => Object.keys(m).map(k => k !== 'default' && (exports[k] = m[k])))\n(require('./local.js'));`
},
// imports
{
esm: `import * as name from "module-name";`,
Expand Down Expand Up @@ -156,4 +160,4 @@ console.log(
) ===
`'use strict';\nconst I = require.I(require("test"));\nfunction E() {}\nrequire.E(exports).default = E`,
'both import and export can be overwritten'
);
);
1 change: 1 addition & 0 deletions test/source/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import func, {a, b} from './module.js';
import * as tmp from 'other';
export * as commands from './local.js'

console.log(import.meta.url);

Expand Down