Skip to content
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

Make TypeScript always transpile modules to CommonJS style #7166

Closed
wants to merge 4 commits into from
Closed
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
2 changes: 1 addition & 1 deletion packages/server/lib/plugins/child/run_plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ module.exports = (ipc, pluginsFile, projectRoot) => {
compiler: tsPath,
transpileOnly: true,
compilerOptions: {

module: 'CommonJS',
esModuleInterop: true,
},
})
Expand Down
4 changes: 4 additions & 0 deletions packages/server/lib/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ class Project extends EE {
tsnode.register({
compiler: tsPath,
transpileOnly: true,
compilerOptions: {
module: 'CommonJS',
esModuleInterop: true,
},
})
} catch (e) {
debug(`typescript doesn't exist. ts-node setup passed.`)
Expand Down
4 changes: 4 additions & 0 deletions packages/server/test/unit/project_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ This option will not have an effect in Some-other-name. Tests that rely on web s
expect(register).to.be.calledWith({
transpileOnly: true,
compiler: projTsPath,
compilerOptions: {
module: 'CommonJS',
esModuleInterop: true,
},
})
})
})
Expand Down