diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-default-hybrid/a.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-default-hybrid/a.js new file mode 100644 index 00000000000..7f129231c85 --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-default-hybrid/a.js @@ -0,0 +1,3 @@ +import b from './b'; + +output = b.foo + b.bar; diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-default-hybrid/b.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-default-hybrid/b.js new file mode 100644 index 00000000000..1d134aa51d1 --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-default-hybrid/b.js @@ -0,0 +1,2 @@ +import * as c from './c'; +export default c; diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-default-hybrid/c.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-default-hybrid/c.js new file mode 100644 index 00000000000..29a35de9403 --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-default-hybrid/c.js @@ -0,0 +1,2 @@ +export foo from './d'; +export const bar = require('./d'); diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-default-hybrid/d.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-default-hybrid/d.js new file mode 100644 index 00000000000..bd816eaba4c --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-default-hybrid/d.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-hybrid/a.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-hybrid/a.js new file mode 100644 index 00000000000..d1d39e3bc64 --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-hybrid/a.js @@ -0,0 +1,3 @@ +import {foo, bar} from './b'; + +output = foo + bar; diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-hybrid/b.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-hybrid/b.js new file mode 100644 index 00000000000..34a28aa08d0 --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-hybrid/b.js @@ -0,0 +1 @@ +export * from './c'; diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-hybrid/c.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-hybrid/c.js new file mode 100644 index 00000000000..29a35de9403 --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-hybrid/c.js @@ -0,0 +1,2 @@ +export foo from './d'; +export const bar = require('./d'); diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-hybrid/d.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-hybrid/d.js new file mode 100644 index 00000000000..bd816eaba4c --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-hybrid/d.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/packages/core/integration-tests/test/scope-hoisting.js b/packages/core/integration-tests/test/scope-hoisting.js index 63ddafd760a..2c9508fe405 100644 --- a/packages/core/integration-tests/test/scope-hoisting.js +++ b/packages/core/integration-tests/test/scope-hoisting.js @@ -1997,6 +1997,28 @@ describe('scope hoisting', function () { assert(new output[3]() instanceof output[2]); }); + it('should support chained reexports from hybrid modules', async function () { + let b = await bundle( + path.join( + __dirname, + '/integration/scope-hoisting/es6/re-export-hybrid/a.js', + ), + ); + let output = await run(b); + assert.strictEqual(output, 2); + }); + + it('should support chained reexports as default from hybrid modules', async function () { + let b = await bundle( + path.join( + __dirname, + '/integration/scope-hoisting/es6/re-export-default-hybrid/a.js', + ), + ); + let output = await run(b); + assert.strictEqual(output, 2); + }); + it('support chained namespace reexports of CommonJS', async function () { let b = await bundle( path.join(