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

fix(ts): fix typescript default module compilerOption #4886

Merged
merged 1 commit into from
Jan 29, 2019

Conversation

kevinmarrec
Copy link
Contributor

@kevinmarrec kevinmarrec commented Jan 29, 2019

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

ts-loader needs to run with module: 'esnext' to handle async Components (i.e. () => import('path/to/component')) in TypeScript Vue SFC.

Meanwhile ts-node needs to run with module: 'commonjs' to be able to transpile without errors RunTime TypeScript files such as nuxt.config.ts, modules & serverMiddlewares.

There is no workaround (or maybe a really tricky one by setting a different tsconfig.json config through build.loaders.ts options), so it's a HOTFIX.
Which make everything work in any case.

I also removed a duplicated test.

Thanks @dschewchenko for finding the issue regarding the import of async components using nuxt-ts

Checklist:

  • I have updated tests to cover my changes (if not applicable, please state why)
  • All updated and existing tests are passing.

@kevinmarrec kevinmarrec changed the title fix tsconfig + remove forgotten duplicated test fix(ts): fix typescript default module compilerOption Jan 29, 2019
@codecov-io
Copy link

codecov-io commented Jan 29, 2019

Codecov Report

Merging #4886 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #4886   +/-   ##
=======================================
  Coverage   91.66%   91.66%           
=======================================
  Files          72       72           
  Lines        2399     2399           
  Branches      592      592           
=======================================
  Hits         2199     2199           
  Misses        182      182           
  Partials       18       18
Impacted Files Coverage Δ
packages/typescript/src/index.js 68.42% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e9ba2f9...25c1749. Read the comment docs.

@pi0 pi0 merged commit 774823b into nuxt:dev Jan 29, 2019
@kevinmarrec kevinmarrec deleted the fix-tsconfig branch January 29, 2019 19:25
@kevinmarrec kevinmarrec restored the fix-tsconfig branch January 29, 2019 19:26
@pi0 pi0 mentioned this pull request Jan 29, 2019
clarkdo pushed a commit that referenced this pull request Jan 30, 2019
# Bugfixes 

* Handle `async` components correctly when using `nuxt-ts` (PR #4886)
* Fix `extractCSS` in `dev` mode (PR #4888)
* Correctly apply class when using `linkPrefetchedClass` (PR #4893)
@kevinmarrec kevinmarrec deleted the fix-tsconfig branch February 20, 2019 16:30
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants