-
-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typescript): fix ESM build (#1311)
Do not use named imports from TypeScript
- Loading branch information
1 parent
fa80acc
commit dfd4de3
Showing
11 changed files
with
40 additions
and
13 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { | ||
import type { | ||
ModuleResolutionHost, | ||
ResolvedModuleFull, | ||
ResolvedProjectReference, | ||
|
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
2 changes: 1 addition & 1 deletion
2
packages/typescript/test/fixtures/incremental-single/tsconfig.tsbuildinfo
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,23 @@ | ||
import { fileURLToPath } from 'url'; | ||
|
||
import test from 'ava'; | ||
|
||
import { rollup } from 'rollup'; | ||
|
||
import typescript from 'current-package'; | ||
|
||
import { getCode, onwarn } from '../../../util/test.js'; | ||
|
||
test.beforeEach(() => process.chdir(fileURLToPath(new URL('.', import.meta.url)))); | ||
|
||
test.serial('works as ESM build', async (t) => { | ||
const bundle = await rollup({ | ||
input: 'fixtures/basic/main.ts', | ||
plugins: [typescript({ tsconfig: 'fixtures/basic/tsconfig.json', target: 'es5' })], | ||
onwarn | ||
}); | ||
const code = await getCode(bundle, { format: 'es' }); | ||
|
||
t.false(code.includes('number'), code); | ||
t.false(code.includes('const'), code); | ||
}); |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export default { | ||
workerThreads: false, | ||
extensions: ['js', 'ts'], | ||
extensions: ['js', 'mjs', 'ts'], | ||
files: ['!**/fixtures/**', '!**/output/**', '!**/helpers/**', '!**/recipes/**', '!**/types.ts'], | ||
require: ['ts-node/register', 'esm'] | ||
}; |