From 98a87604b402fa3f67f8e59d9e2a647bdfd89bc1 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 13 Nov 2024 22:37:49 +0800 Subject: [PATCH] fix: should transpile all Vue SFC (#5) --- src/index.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 859cae2..4b9eca7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,9 @@ import { createRequire } from 'node:module'; -import type { RsbuildPlugin, RspackChain } from '@rsbuild/core'; +import type { + EnvironmentConfig, + RsbuildPlugin, + RspackChain, +} from '@rsbuild/core'; import { type VueLoaderOptions, VueLoaderPlugin } from 'vue-loader'; import { VueLoader15PitchFixPlugin } from './VueLoader15PitchFixPlugin.js'; import { applySplitChunksRule } from './splitChunks.js'; @@ -41,7 +45,7 @@ export function pluginVue2(options: PluginVueOptions = {}): RsbuildPlugin { const VUE_REGEXP = /\.vue$/; const CSS_MODULES_REGEX = /\.modules?\.\w+$/i; - api.modifyEnvironmentConfig((config) => { + api.modifyEnvironmentConfig((config, { mergeEnvironmentConfig }) => { // Support `