Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c76f5e5

Browse filesBrowse files
committed
fix: disable esModuleInterop & allowSyntheticDefaultImports for TS
Otherwise the emitted type definitions may break downstream users who do not have these options enabled. Thanks @meteorlxy for spotting this issue.
1 parent 6ed553f commit c76f5e5
Copy full SHA for c76f5e5

12 files changed

+26
-26
lines changed

‎src/formatError.ts

Copy file name to clipboardExpand all lines: src/formatError.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { generateCodeFrame, CompilerError } from '@vue/compiler-sfc'
2-
import chalk from 'chalk'
2+
import chalk = require('chalk')
33

44
export function formatError(
55
err: SyntaxError | CompilerError,

‎src/index.ts

Copy file name to clipboardExpand all lines: src/index.ts
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ try {
77
)
88
}
99

10-
import webpack from 'webpack'
11-
import path from 'path'
12-
import qs from 'querystring'
13-
import hash from 'hash-sum'
14-
import loaderUtils from 'loader-utils'
10+
import webpack = require('webpack')
11+
import * as path from 'path'
12+
import * as qs from 'querystring'
13+
import * as loaderUtils from 'loader-utils'
14+
15+
import hash = require('hash-sum')
16+
1517
import {
1618
parse,
1719
compileScript,

‎src/pitcher.ts

Copy file name to clipboardExpand all lines: src/pitcher.ts
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import webpack from 'webpack'
2-
import qs from 'querystring'
3-
import loaderUtils from 'loader-utils'
1+
import webpack = require('webpack')
2+
import * as qs from 'querystring'
3+
import * as loaderUtils from 'loader-utils'
44

55
const selfPath = require.resolve('./index')
66
// const templateLoaderPath = require.resolve('./templateLoader')
@@ -69,7 +69,7 @@ export const pitch = function () {
6969
return genProxyModule(
7070
[...afterLoaders, stylePostLoaderPath, ...beforeLoaders],
7171
context,
72-
!! query.module
72+
!!query.module
7373
)
7474
}
7575
}

‎src/plugin.ts

Copy file name to clipboardExpand all lines: src/plugin.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import webpack from 'webpack'
1+
import webpack = require('webpack')
22
declare class VueLoaderPlugin implements webpack.Plugin {
33
static NS: string
44
apply(compiler: webpack.Compiler): void

‎src/pluginWebpack4.ts

Copy file name to clipboardExpand all lines: src/pluginWebpack4.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import qs from 'querystring'
2-
import webpack from 'webpack'
1+
import * as qs from 'querystring'
2+
import webpack = require('webpack')
33
import { VueLoaderOptions } from './'
44

55
const RuleSet = require('webpack/lib/RuleSet')

‎src/pluginWebpack5.ts

Copy file name to clipboardExpand all lines: src/pluginWebpack5.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import qs from 'querystring'
1+
import * as qs from 'querystring'
22
import { VueLoaderOptions } from './'
33
import { RuleSetRule, Compiler, Plugin } from 'webpack'
44

‎src/select.ts

Copy file name to clipboardExpand all lines: src/select.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import webpack from 'webpack'
1+
import webpack = require('webpack')
22
import { SFCDescriptor } from '@vue/compiler-sfc'
33
import { ParsedUrlQuery } from 'querystring'
44

‎src/stylePostLoader.ts

Copy file name to clipboardExpand all lines: src/stylePostLoader.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import qs from 'querystring'
1+
import * as qs from 'querystring'
22
import { compileStyle } from '@vue/compiler-sfc'
3-
import webpack from 'webpack'
3+
import webpack = require('webpack')
44

55
// This is a post loader that handles scoped CSS transforms.
66
// Injected right before css-loader by the global pitcher (../pitch.js)

‎src/templateLoader.ts

Copy file name to clipboardExpand all lines: src/templateLoader.ts
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import webpack from 'webpack'
2-
import qs from 'querystring'
3-
import loaderUtils from 'loader-utils'
1+
import webpack = require('webpack')
2+
import * as qs from 'querystring'
3+
import * as loaderUtils from 'loader-utils'
44
import { VueLoaderOptions } from './'
55
import { formatError } from './formatError'
66
import { compileTemplate, TemplateCompiler } from '@vue/compiler-sfc'

‎test/edgeCases.spec.ts

Copy file name to clipboardExpand all lines: test/edgeCases.spec.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as path from 'path'
2-
import HTMLPlugin from 'html-webpack-plugin'
2+
import HTMLPlugin = require('html-webpack-plugin')
33
import { mfs, bundle, mockBundleAndRun, normalizeNewline } from './utils'
44

55
// @ts-ignore

‎test/utils.ts

Copy file name to clipboardExpand all lines: test/utils.ts
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* env jest */
2-
import path from 'path'
3-
import webpack from 'webpack'
2+
import * as path from 'path'
3+
import webpack = require('webpack')
44
import merge from 'webpack-merge'
5-
import hash from 'hash-sum'
5+
import hash = require('hash-sum')
66
// import MiniCssExtractPlugin from 'mini-css-extract-plugin'
77
import { fs as mfs } from 'memfs'
88

‎tsconfig.json

Copy file name to clipboardExpand all lines: tsconfig.json
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66
"target": "es2015",
77
"module": "commonjs",
88
"moduleResolution": "node",
9-
"esModuleInterop": true,
109
"declaration": true,
1110
"allowJs": false,
12-
"allowSyntheticDefaultImports": true,
1311
"noUnusedLocals": true,
1412
"strictNullChecks": true,
1513
"noImplicitAny": true,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.