Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 10531f8

Browse files
authored
feat: support esbuild (#91)
1 parent 9dc0cc6 commit 10531f8

File tree

4 files changed

+26
-2
lines changed

4 files changed

+26
-2
lines changed

Diff for: README.md

+19-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![NPM version](https://img.shields.io/npm/v/unplugin-vue2-script-setup?color=a1b858&label=)](https://www.npmjs.com/package/unplugin-vue2-script-setup)
44

5-
Bring [`<script setup>`](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to Vue 2. Works for Vite, Nuxt, Vue CLI, Webpack and more, powered by [unplugin](https://github.com/unjs/unplugin).
5+
Bring [`<script setup>`](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to Vue 2. Works for Vite, Nuxt, Vue CLI, Webpack, esbuild and more, powered by [unplugin](https://github.com/unjs/unplugin).
66

77
## Install
88

@@ -203,6 +203,24 @@ export default {
203203

204204
<br></details>
205205

206+
<details>
207+
<summary>esbuild</summary><br>
208+
209+
```ts
210+
// esbuild.config.js
211+
import { build } from 'esbuild'
212+
build({
213+
/* ... */
214+
plugins: [
215+
require('unplugin-vue2-script-setup/esbuild')({
216+
/* options */
217+
}),
218+
],
219+
})
220+
```
221+
222+
<br></details>
223+
206224
<details>
207225
<summary>Jest</summary><br>
208226

Diff for: esbuild.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import './shims'
2+
export { default } from './dist/esbuild'

Diff for: package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"./rollup": "./dist/rollup.js",
2323
"./types": "./dist/types.js",
2424
"./vite": "./dist/vite.js",
25-
"./webpack": "./dist/webpack.js"
25+
"./webpack": "./dist/webpack.js",
26+
"./esbuild": "./dist/esbuild.js"
2627
},
2728
"main": "dist/index.js",
2829
"types": "index.d.ts",

Diff for: src/esbuild.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import unplugin from '.'
2+
3+
export default unplugin.esbuild

0 commit comments

Comments
 (0)