Skip to content

Commit 44bb4da

Browse files
authored
chore(deps): update to esbuild fixed at 0.14.3 (vitejs#5861)
1 parent 9ad7c55 commit 44bb4da

File tree

7 files changed

+618
-969
lines changed

7 files changed

+618
-969
lines changed

docs/guide/features.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ But a few libraries haven't transitioned to this new default yet, including [`li
7070

7171
- [`extends`](https://www.typescriptlang.org/tsconfig#extends)
7272
- [`importsNotUsedAsValues`](https://www.typescriptlang.org/tsconfig#importsNotUsedAsValues)
73+
- [`preserveValueImports`](https://www.typescriptlang.org/tsconfig#preserveValueImports)
7374
- [`jsxFactory`](https://www.typescriptlang.org/tsconfig#jsxFactory)
7475
- [`jsxFragmentFactory`](https://www.typescriptlang.org/tsconfig#jsxFragmentFactory)
7576

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"chalk": "^4.1.2",
3636
"conventional-changelog-cli": "^2.1.1",
3737
"cross-env": "^7.0.3",
38-
"esbuild": "^0.13.12",
38+
"esbuild": "0.14.3",
3939
"eslint": "^8.4.1",
4040
"eslint-define-config": "^1.2.0",
4141
"eslint-plugin-node": "^11.1.0",

packages/playground/tsconfig-json/__tests__/tsconfig-json.spec.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ describe('transformWithEsbuild', () => {
3131
}
3232
})
3333
// "importsNotUsedAsValues": "preserve" from tsconfig.json should still work
34-
expect(result.code).toContain(
35-
'import { MainTypeOnlyClass } from "./not-used-type";'
36-
)
34+
expect(result.code).toContain('import "./not-used-type";')
3735
})
3836

3937
test('overwrite tsconfigRaw string', async () => {
@@ -48,7 +46,22 @@ describe('transformWithEsbuild', () => {
4846
})
4947
// "importsNotUsedAsValues": "preserve" from tsconfig.json should not be read
5048
// and defaults to "remove"
51-
expect(result.code).not.toContain(
49+
expect(result.code).not.toContain('import "./not-used-type";')
50+
})
51+
52+
test('preserveValueImports', async () => {
53+
const main = path.resolve(__dirname, '../src/main.ts')
54+
const mainContent = fs.readFileSync(main, 'utf-8')
55+
const result = await transformWithEsbuild(mainContent, main, {
56+
tsconfigRaw: {
57+
compilerOptions: {
58+
useDefineForClassFields: false,
59+
preserveValueImports: true
60+
}
61+
}
62+
})
63+
// "importsNotUsedAsValues": "preserve" from tsconfig.json should still work
64+
expect(result.code).toContain(
5265
'import { MainTypeOnlyClass } from "./not-used-type";'
5366
)
5467
})

packages/vite/LICENSE.md

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -587,23 +587,6 @@ Repository: https://github.com/micromatch/anymatch
587587
588588
---------------------------------------
589589

590-
## array-union
591-
License: MIT
592-
By: Sindre Sorhus
593-
Repository: sindresorhus/array-union
594-
595-
> MIT License
596-
>
597-
> Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
598-
>
599-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
600-
>
601-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
602-
>
603-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
604-
605-
---------------------------------------
606-
607590
## balanced-match
608591
License: MIT
609592
By: Julian Gruber
@@ -1142,23 +1125,6 @@ Repository: sindresorhus/define-lazy-prop
11421125
11431126
---------------------------------------
11441127

1145-
## dir-glob
1146-
License: MIT
1147-
By: Kevin Mårtensson
1148-
Repository: kevva/dir-glob
1149-
1150-
> MIT License
1151-
>
1152-
> Copyright (c) Kevin Mårtensson <[email protected]> (github.com/kevva)
1153-
>
1154-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1155-
>
1156-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1157-
>
1158-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1159-
1160-
---------------------------------------
1161-
11621128
## dotenv
11631129
License: BSD-2-Clause
11641130
Repository: git://github.com/motdotla/dotenv.git
@@ -1702,23 +1668,6 @@ Repository: gulpjs/glob-parent
17021668
17031669
---------------------------------------
17041670

1705-
## globby
1706-
License: MIT
1707-
By: Sindre Sorhus
1708-
Repository: sindresorhus/globby
1709-
1710-
> MIT License
1711-
>
1712-
> Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
1713-
>
1714-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1715-
>
1716-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1717-
>
1718-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1719-
1720-
---------------------------------------
1721-
17221671
## http-proxy
17231672
License: MIT
17241673
By: Charlie Robbins
@@ -1979,35 +1928,6 @@ Repository: git+https://github.com/css-modules/icss-utils.git
19791928
19801929
---------------------------------------
19811930

1982-
## ignore
1983-
License: MIT
1984-
By: kael
1985-
Repository: [email protected]:kaelzhang/node-ignore.git
1986-
1987-
> Copyright (c) 2013 Kael Zhang <[email protected]>, contributors
1988-
> http://kael.me/
1989-
>
1990-
> Permission is hereby granted, free of charge, to any person obtaining
1991-
> a copy of this software and associated documentation files (the
1992-
> "Software"), to deal in the Software without restriction, including
1993-
> without limitation the rights to use, copy, modify, merge, publish,
1994-
> distribute, sublicense, and/or sell copies of the Software, and to
1995-
> permit persons to whom the Software is furnished to do so, subject to
1996-
> the following conditions:
1997-
>
1998-
> The above copyright notice and this permission notice shall be
1999-
> included in all copies or substantial portions of the Software.
2000-
>
2001-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2002-
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2003-
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
2004-
> NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
2005-
> LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
2006-
> OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
2007-
> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2008-
2009-
---------------------------------------
2010-
20111931
## import-cwd
20121932
License: MIT
20131933
By: Sindre Sorhus
@@ -3332,23 +3252,6 @@ Repository: sindresorhus/path-key
33323252
33333253
---------------------------------------
33343254

3335-
## path-type
3336-
License: MIT
3337-
By: Sindre Sorhus
3338-
Repository: sindresorhus/path-type
3339-
3340-
> MIT License
3341-
>
3342-
> Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
3343-
>
3344-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3345-
>
3346-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
3347-
>
3348-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3349-
3350-
---------------------------------------
3351-
33523255
## periscopic
33533256
License: MIT
33543257
Repository: Rich-Harris/periscopic
@@ -4031,23 +3934,6 @@ Repository: lukeed/sirv
40313934

40323935
---------------------------------------
40333936

4034-
## slash
4035-
License: MIT
4036-
By: Sindre Sorhus
4037-
Repository: sindresorhus/slash
4038-
4039-
> MIT License
4040-
>
4041-
> Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
4042-
>
4043-
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4044-
>
4045-
> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
4046-
>
4047-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
4048-
4049-
---------------------------------------
4050-
40513937
## source-map
40523938
License: BSD-3-Clause
40533939
By: Nick Fitzgerald, Tobias Koppers, Duncan Beevers, Stephen Crane, Ryan Seddon, Miles Elam, Mihai Bazon, Michael Ficarra, Todd Wolfson, Alexander Solovyov, Felix Gnass, Conrad Irwin, usrbincc, David Glasser, Chase Douglas, Evan Wallace, Heather Arthur, Hugh Kennedy, Simon Lydell, Jmeas Smith, Michael Z Goddard, azu, John Gozde, Adam Kirkton, Chris Montgomery, J. Ryan Stinnett, Jack Herrington, Chris Truter, Daniel Espeset, Jamie Wong, Eddy Bruël, Hawken Rives, Gilad Peleg, djchie, Gary Ye, Nicolas Lalevée

packages/vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
4646
"dependencies": {
47-
"esbuild": "^0.13.12",
47+
"esbuild": "0.14.3",
4848
"json5": "^2.2.0",
4949
"postcss": "^8.4.5",
5050
"resolve": "^1.20.0",

packages/vite/src/node/plugins/esbuild.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type TSConfigJSON = {
4545
jsxFragmentFactory?: string
4646
useDefineForClassFields?: boolean
4747
importsNotUsedAsValues?: 'remove' | 'preserve' | 'error'
48+
preserveValueImports?: boolean
4849
}
4950
[key: string]: any
5051
}
@@ -82,7 +83,8 @@ export async function transformWithEsbuild(
8283
'jsxFactory',
8384
'jsxFragmentFactory',
8485
'useDefineForClassFields',
85-
'importsNotUsedAsValues'
86+
'importsNotUsedAsValues',
87+
'preserveValueImports'
8688
]
8789
const compilerOptionsForFile: TSCompilerOptions = {}
8890
if (loader === 'ts' || loader === 'tsx') {

0 commit comments

Comments
 (0)