Skip to content

Conversation

haoqunjiang
Copy link
Member

@haoqunjiang haoqunjiang commented May 9, 2020

This change fixes the emitted TypeScript type definitions

Closes #1667.

@haoqunjiang haoqunjiang marked this pull request as ready for review May 11, 2020 13:08
@haoqunjiang haoqunjiang requested a review from yyx990803 May 11, 2020 13:11
let errorEmitted = false

const loader: webpack.loader.Loader = function(source: string) {
export default function loader(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would require require('vue-loader').default? Does webpack have built-in esModule default interop?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, webpack uses loader-runner to run loaders, and it supports .default https://github.com/webpack/loader-runner/blob/master/lib/loadLoader.js#L26

Or we can provide another .cjs entry if compatibility is a concern.
But I don't think it's necessary, as vue-loader is only supposed to be called by webpack.

@haoqunjiang haoqunjiang merged commit 0b35f5c into vuejs:next May 12, 2020
@haoqunjiang haoqunjiang deleted the fix-ts-epxorts branch May 12, 2020 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants