Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@typescript-eslint/parser": "^5.8.1",
"conventional-changelog-cli": "^2.2.2",
"cross-env": "^7.0.3",
"esbuild": "0.14.3",
"esbuild": "^0.14.14",
"eslint": "^8.5.0",
"eslint-define-config": "^1.2.1",
"eslint-plugin-node": "^11.1.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"scripts": {
"dev": "tsc -p . -w --incremental",
"build": "rimraf dist && run-s build-bundle build-types",
"build-bundle": "esbuild src/index.ts --bundle --platform=node --target=node12 --external:@babel/* --external:@rollup/* --external:resolve --external:react-refresh/* --outfile=dist/index.js",
"build-bundle": "esbuild src/index.ts --bundle --platform=node --target=node12 --external:@babel/* --external:@rollup/* --external:resolve --external:react-refresh/* --outfile=dist/index.js && npm run patch-dist",
"patch-dist": "ts-node ../../scripts/patchEsbuildDist.ts dist/index.js viteReact",
"build-types": "tsc -p . --emitDeclarationOnly --outDir temp && api-extractor run && rimraf temp",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . --lerna-package plugin-react",
"release": "ts-node ../../scripts/release.ts"
Expand Down
7 changes: 5 additions & 2 deletions packages/plugin-react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,5 +366,8 @@ function loadPlugin(path: string): Promise<any> {
}

// overwrite for cjs require('...')() usage
module.exports = viteReact
viteReact['default'] = viteReact
// The following lines are inserted by scripts/patchEsbuildDist.ts,
// this doesn't bundle correctly after esbuild 0.14.4
//
// module.exports = viteReact
// viteReact['default'] = viteReact
Comment thread
patak-cat marked this conversation as resolved.
3 changes: 2 additions & 1 deletion packages/plugin-react/src/jsx-runtime/restore-jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export async function restoreJSX(
parserOpts: {
plugins: ['jsx']
},
plugins: [await babelRestoreJSX]
// @ts-ignore
plugins: [(await babelRestoreJSX).default]
})

return [result?.ast, isCommonJS]
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"dev-types": "tsc -p . -w --incremental --emitDeclarationOnly",
"dev-watch": "esbuild src/index.ts --watch --bundle --platform=node --target=node12 --external:@vue/compiler-sfc --external:vue/compiler-sfc --external:vite --outfile=dist/index.js",
"build": "rimraf dist && run-s build-bundle build-types",
"build-bundle": "esbuild src/index.ts --bundle --platform=node --target=node12 --external:@vue/compiler-sfc --external:vue/compiler-sfc --external:vite --outfile=dist/index.js",
"build-bundle": "esbuild src/index.ts --bundle --platform=node --target=node12 --external:@vue/compiler-sfc --external:vue/compiler-sfc --external:vite --outfile=dist/index.js & npm run patch-dist",
"patch-dist": "ts-node ../../scripts/patchEsbuildDist.ts dist/index.js vuePlugin",
"build-types": "tsc -p . --emitDeclarationOnly --outDir temp && api-extractor run && rimraf temp",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . --lerna-package plugin-vue",
"release": "ts-node ../../scripts/release.ts"
Expand Down
7 changes: 5 additions & 2 deletions packages/plugin-vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,5 +244,8 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin {
}

// overwrite for cjs require('...')() usage
module.exports = vuePlugin
vuePlugin['default'] = vuePlugin
// The following lines are inserted by scripts/patchEsbuildDist.ts,
// this doesn't bundle correctly after esbuild 0.14.4
//
// module.exports = vuePlugin
// vuePlugin['default'] = vuePlugin
Loading