Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85f1899
commit 004fb25
Showing
24 changed files
with
130 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
test/chunking-form/samples/mixed-synthetic-named-exports-2/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
description: 'mixed synthetic named exports', | ||
options: { | ||
input: ['main.js'], | ||
plugins: [ | ||
{ | ||
resolveId(id) { | ||
if (id === './dep1.js' || id === './dep2.js') { | ||
return { | ||
id, | ||
syntheticNamedExports: true | ||
}; | ||
} | ||
return null; | ||
} | ||
} | ||
] | ||
} | ||
}; |
7 changes: 7 additions & 0 deletions
7
test/chunking-form/samples/mixed-synthetic-named-exports-2/_expected/amd/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
define(function () { 'use strict'; | ||
|
||
var dep2 = {bar: {foo: 'works'}}; | ||
|
||
console.log(dep2.bar.foo); | ||
|
||
}); |
5 changes: 5 additions & 0 deletions
5
test/chunking-form/samples/mixed-synthetic-named-exports-2/_expected/cjs/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
var dep2 = {bar: {foo: 'works'}}; | ||
|
||
console.log(dep2.bar.foo); |
3 changes: 3 additions & 0 deletions
3
test/chunking-form/samples/mixed-synthetic-named-exports-2/_expected/es/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var dep2 = {bar: {foo: 'works'}}; | ||
|
||
console.log(dep2.bar.foo); |
12 changes: 12 additions & 0 deletions
12
test/chunking-form/samples/mixed-synthetic-named-exports-2/_expected/system/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
System.register([], function () { | ||
'use strict'; | ||
return { | ||
execute: function () { | ||
|
||
var dep2 = {bar: {foo: 'works'}}; | ||
|
||
console.log(dep2.bar.foo); | ||
|
||
} | ||
}; | ||
}); |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/mixed-synthetic-named-exports-2/dep1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {bar as default} from './dep2.js'; |
1 change: 1 addition & 0 deletions
1
test/chunking-form/samples/mixed-synthetic-named-exports-2/dep2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default {bar: {foo: 'works'}}; |
2 changes: 2 additions & 0 deletions
2
test/chunking-form/samples/mixed-synthetic-named-exports-2/main.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { foo } from './dep1.js'; | ||
console.log(foo); |
2 changes: 1 addition & 1 deletion
2
test/chunking-form/samples/mixed-synthetic-named-exports/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
test/function/samples/external-synthetic-exports/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
module.exports = { | ||
description: 'external modules can not have syntheticNamedExports', | ||
solo: true, | ||
options: { | ||
plugins: [ | ||
{ | ||
resolveId(id) { | ||
if (id === 'dep') { | ||
return { | ||
id, | ||
external: true, | ||
syntheticNamedExports: true | ||
}; | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
warnings: [ | ||
{ | ||
code: 'EXTERNAL_SYNTHETIC_EXPORTS', | ||
importer: 'main.js', | ||
source: 'dep', | ||
message: "External 'dep' can not have 'syntheticNamedExports' enabled" | ||
} | ||
], | ||
context: { | ||
require() { | ||
return 1; | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { foo } from 'dep'; | ||
foo; |