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(esbuild): transpile with esnext in dev #10207

Merged
merged 2 commits into from Sep 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/plugin-vue/src/main.ts
Expand Up @@ -221,7 +221,11 @@ export async function transformMain(
const { code, map } = await transformWithEsbuild(
resolvedCode,
filename,
{ loader: 'ts', sourcemap: options.sourceMap },
{
loader: 'ts',
target: 'esnext',
sourcemap: options.sourceMap
},
resolvedMap
)
resolvedCode = code
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/package.json
Expand Up @@ -58,7 +58,7 @@
},
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
"dependencies": {
"esbuild": "^0.15.6",
"esbuild": "^0.15.9",
"postcss": "^8.4.16",
"resolve": "^1.22.1",
"rollup": "~2.78.0"
Expand Down
1 change: 1 addition & 0 deletions packages/vite/src/node/plugins/esbuild.ts
Expand Up @@ -179,6 +179,7 @@ export function esbuildPlugin(options: ESBuildOptions = {}): Plugin {
// Remove optimization options for dev as we only need to transpile them,
// and for build as the final optimization is in `buildEsbuildPlugin`
const transformOptions: TransformOptions = {
target: 'esnext',
...options,
minify: false,
minifyIdentifiers: false,
Expand Down
7 changes: 7 additions & 0 deletions playground/vue/tsconfig.json
@@ -0,0 +1,7 @@
{
"compilerOptions": {
// esbuild transpile should ignore this
"target": "ES5"
},
"include": ["src"]
}