This repository has been archived by the owner on Apr 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
esm: store json modules in CJS cache
- Loading branch information
1 parent
842ce61
commit d178e75
Showing
5 changed files
with
46 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Flags: --experimental-modules --experimental-json-modules | ||
/* eslint-disable node-core/required-modules */ | ||
import '../common/index.mjs'; | ||
import {strictEqual} from 'assert'; | ||
|
||
import mod from '../fixtures/es-modules/json-cache/mod.cjs'; | ||
import another from '../fixtures/es-modules/json-cache/another.cjs'; | ||
import test from '../fixtures/es-modules/json-cache/test.json'; | ||
|
||
|
||
strictEqual(mod.one, 1); | ||
strictEqual(another.one, 'zalgo'); | ||
strictEqual(test.one, 'it comes'); |
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 @@ | ||
const test = require('./test.json'); | ||
|
||
module.exports = { | ||
...test | ||
}; | ||
|
||
test.one = 'it comes'; |
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 @@ | ||
const test = require('./test.json'); | ||
|
||
module.exports = { | ||
...test | ||
} | ||
|
||
test.one = 'zalgo'; |
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 @@ | ||
{ | ||
"one": 1, | ||
"two": 2, | ||
"three": 3 | ||
} |