diff --git a/.github/workflows/release-continuous.yml b/.github/workflows/release-continuous.yml new file mode 100644 index 0000000..541b223 --- /dev/null +++ b/.github/workflows/release-continuous.yml @@ -0,0 +1,24 @@ +name: Publish Any Commit +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - run: corepack enable + - uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: pnpm + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm build + + - run: pnpx pkg-pr-new publish diff --git a/package.json b/package.json index 53e2e4b..93b35ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "unplugin-vue", - "version": "5.1.2", + "version": "5.1.3", "packageManager": "pnpm@9.6.0", "description": "Transform Vue 3 SFC to JavaScript.", "type": "module", diff --git a/src/core/index.ts b/src/core/index.ts index 34c9331..812d4b2 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -155,19 +155,31 @@ export type ResolvedOptions = Omit & | 'root' | 'compiler' | 'inlineTemplate' + | 'features' > > & { /** Vite only */ devServer?: ViteDevServer devToolsEnabled?: boolean cssDevSourcemap: boolean - features: NonNullable } function resolveOptions(rawOptions: Options): ResolvedOptions { const root = rawOptions.root ?? process.cwd() const isProduction = rawOptions.isProduction ?? process.env.NODE_ENV === 'production' + const features = { + ...rawOptions.features, + optionsAPI: true, + prodDevtools: false, + prodHydrationMismatchDetails: false, + propsDestructure: false, + ...rawOptions.features, + customElement: + (rawOptions.features?.customElement || rawOptions.customElement) ?? + /\.ce\.vue$/, + } + return { ...rawOptions, include: rawOptions.include ?? /\.vue$/, @@ -176,19 +188,10 @@ function resolveOptions(rawOptions: Options): ResolvedOptions { sourceMap: rawOptions.sourceMap ?? true, root, compiler: rawOptions.compiler as any, // to be set in buildStart - devToolsEnabled: !isProduction, + devToolsEnabled: features.prodDevtools || !isProduction, cssDevSourcemap: false, inlineTemplate: rawOptions.inlineTemplate ?? true, - features: { - optionsAPI: true, - prodDevtools: false, - prodHydrationMismatchDetails: false, - propsDestructure: false, - ...rawOptions.features, - customElement: - (rawOptions.features?.customElement || rawOptions.customElement) ?? - /\.ce\.vue$/, - }, + features, } }