mirror of
https://github.com/vitejs/vite.git
synced 2024-11-21 22:59:10 +00:00
build!: bump targets (#8045)
This commit is contained in:
parent
e23ba3593c
commit
66efd69a39
@ -745,7 +745,7 @@ export default defineConfig({
|
||||
|
||||
Another special value is `'esnext'` - which assumes native dynamic imports support and will transpile as little as possible:
|
||||
|
||||
- If the [`build.minify`](#build-minify) option is `'terser'`, `'esnext'` will be forced down to `'es2019'`.
|
||||
- If the [`build.minify`](#build-minify) option is `'terser'`, `'esnext'` will be forced down to `'es2021'`.
|
||||
- In other cases, it will perform no transpilation at all.
|
||||
|
||||
The transform is performed with esbuild and the value should be a valid [esbuild target option](https://esbuild.github.io/api/#target). Custom targets can either be a ES version (e.g. `es2015`), a browser with version (e.g. `chrome58`), or an array of multiple target strings.
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "esnext",
|
||||
"lib": ["es2017", "dom", "dom.iterable"],
|
||||
"module": "ESNext",
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"outDir": "./types",
|
||||
@ -10,7 +10,7 @@
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "Node",
|
||||
"isolatedModules": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"experimentalDecorators": true,
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node"
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node"
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node"
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"extends": "@tsconfig/svelte/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "esnext",
|
||||
"module": "ESNext",
|
||||
"resolveJsonModule": true,
|
||||
"baseUrl": ".",
|
||||
/**
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node"
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"moduleResolution": "node",
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "Node",
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
/**
|
||||
* svelte-preprocess cannot figure out whether you have
|
||||
* a value or a type, so tell TypeScript to enforce using
|
||||
|
@ -1,16 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"target": "ESNext",
|
||||
"useDefineForClassFields": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"strict": true,
|
||||
"jsx": "preserve",
|
||||
"sourceMap": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"esModuleInterop": true,
|
||||
"lib": ["esnext", "dom"],
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
||||
|
@ -1,8 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node"
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Node"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
"exclude": ["**/*.spec.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"target": "ES2018",
|
||||
"target": "ES2020",
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "Node",
|
||||
"strict": true,
|
||||
|
@ -3,7 +3,7 @@
|
||||
"exclude": ["**/*.spec.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"target": "ES2018",
|
||||
"target": "ES2020",
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "Node",
|
||||
"strict": true,
|
||||
|
@ -3,7 +3,7 @@
|
||||
"exclude": ["**/*.spec.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"target": "ES2018",
|
||||
"target": "ES2020",
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "Node",
|
||||
"strict": true,
|
||||
|
@ -3,7 +3,7 @@
|
||||
"exclude": ["**/*.spec.ts"],
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"target": "ES2019",
|
||||
"target": "ES2020",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
|
@ -19,7 +19,7 @@ const envConfig = {
|
||||
input: path.resolve(__dirname, 'src/client/env.ts'),
|
||||
plugins: [
|
||||
typescript({
|
||||
target: 'es2018',
|
||||
target: 'es2020',
|
||||
include: ['src/client/env.ts'],
|
||||
baseUrl: path.resolve(__dirname, 'src/env'),
|
||||
paths: {
|
||||
@ -41,7 +41,7 @@ const clientConfig = {
|
||||
external: ['./env', '@vite/env'],
|
||||
plugins: [
|
||||
typescript({
|
||||
target: 'es2018',
|
||||
target: 'es2020',
|
||||
include: ['src/client/**/*.ts'],
|
||||
baseUrl: path.resolve(__dirname, 'src/client'),
|
||||
paths: {
|
||||
@ -128,7 +128,7 @@ const createNodeConfig = (isProduction) => {
|
||||
typescript({
|
||||
tsconfig: 'src/node/tsconfig.json',
|
||||
module: 'esnext',
|
||||
target: 'es2019',
|
||||
target: 'es2020',
|
||||
include: ['src/**/*.ts', 'types/**'],
|
||||
exclude: ['src/**/__tests__/**'],
|
||||
esModuleInterop: true,
|
||||
|
@ -3,7 +3,7 @@
|
||||
"include": ["./", "../../types"],
|
||||
"compilerOptions": {
|
||||
"outDir": "../../dist/client",
|
||||
"module": "esnext",
|
||||
"module": "ESNext",
|
||||
"types": [],
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"declaration": false
|
||||
|
@ -252,8 +252,8 @@ export function resolveBuildOptions(raw?: BuildOptions): ResolvedBuildOptions {
|
||||
'safari13' // transpile nullish coalescing
|
||||
]
|
||||
} else if (resolved.target === 'esnext' && resolved.minify === 'terser') {
|
||||
// esnext + terser: limit to es2019 so it can be minified by terser
|
||||
resolved.target = 'es2019'
|
||||
// esnext + terser: limit to es2021 so it can be minified by terser
|
||||
resolved.target = 'es2021'
|
||||
}
|
||||
|
||||
if (!resolved.cssTarget) {
|
||||
|
@ -3,11 +3,9 @@
|
||||
"include": ["./", "../../types"],
|
||||
"exclude": ["**/__tests__"],
|
||||
"compilerOptions": {
|
||||
// compile away optional-chaining-operator
|
||||
// node support table: https://node.green/#ES2020-features-optional-chaining-operator-----
|
||||
"target": "ES2019",
|
||||
"target": "ES2020",
|
||||
"outDir": "../../dist/node",
|
||||
"module": "commonjs",
|
||||
"module": "CommonJS",
|
||||
"lib": ["ESNext", "DOM"],
|
||||
"sourceMap": true
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2018",
|
||||
"target": "ES2020",
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
"declaration": true,
|
||||
|
@ -3,12 +3,12 @@
|
||||
"include": ["."],
|
||||
"exclude": ["**/dist/**", "**/__tests__/**"],
|
||||
"compilerOptions": {
|
||||
"target": "es2019",
|
||||
"module": "esnext",
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"outDir": "dist",
|
||||
"allowJs": true,
|
||||
"esModuleInterop": true,
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "Node",
|
||||
"baseUrl": ".",
|
||||
"jsx": "preserve",
|
||||
"types": ["vite/client", "node"]
|
||||
|
@ -2,14 +2,14 @@
|
||||
"include": ["."],
|
||||
"exclude": ["**/dist/**"],
|
||||
"compilerOptions": {
|
||||
"target": "es2019",
|
||||
"module": "esnext",
|
||||
"target": "ES2020",
|
||||
"module": "ESNext",
|
||||
"outDir": "dist",
|
||||
"baseUrl": ".",
|
||||
"allowJs": true,
|
||||
"esModuleInterop": true,
|
||||
"resolveJsonModule": true,
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "Node",
|
||||
"skipLibCheck": true,
|
||||
"noUnusedLocals": true,
|
||||
"jsx": "preserve",
|
||||
|
@ -2,9 +2,9 @@
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"include": ["."],
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es2019",
|
||||
"moduleResolution": "node",
|
||||
"module": "CommonJS",
|
||||
"target": "ES2020",
|
||||
"moduleResolution": "Node",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
|
Loading…
Reference in New Issue
Block a user