diff --git a/packages/nuxt/src/components/client-fallback-auto-id.ts b/packages/nuxt/src/components/client-fallback-auto-id.ts index 370122be15..9d642d55f7 100644 --- a/packages/nuxt/src/components/client-fallback-auto-id.ts +++ b/packages/nuxt/src/components/client-fallback-auto-id.ts @@ -44,7 +44,7 @@ export const clientFallbackAutoIdPlugin = createUnplugin((options: LoaderOptions return { code: s.toString(), map: options.sourcemap - ? s.generateMap({ source: id, includeContent: true }) + ? s.generateMap({ hires: true }) : undefined } } diff --git a/packages/nuxt/src/components/loader.ts b/packages/nuxt/src/components/loader.ts index 70043f2e2d..9b01961493 100644 --- a/packages/nuxt/src/components/loader.ts +++ b/packages/nuxt/src/components/loader.ts @@ -33,7 +33,7 @@ export const loaderPlugin = createUnplugin((options: LoaderOptions) => { } return isVueTemplate(id) }, - transform (code, id) { + transform (code) { const components = options.getComponents() let num = 0 @@ -92,7 +92,7 @@ export const loaderPlugin = createUnplugin((options: LoaderOptions) => { return { code: s.toString(), map: options.sourcemap - ? s.generateMap({ source: id, includeContent: true }) + ? s.generateMap({ hires: true }) : undefined } } diff --git a/packages/nuxt/src/components/tree-shake.ts b/packages/nuxt/src/components/tree-shake.ts index 3d6a48fe1d..9136267f4e 100644 --- a/packages/nuxt/src/components/tree-shake.ts +++ b/packages/nuxt/src/components/tree-shake.ts @@ -29,7 +29,7 @@ export const TreeShakeTemplatePlugin = createUnplugin((options: TreeShakeTemplat const { pathname } = parseURL(decodeURIComponent(pathToFileURL(id).href)) return pathname.endsWith('.vue') }, - transform (code, id) { + transform (code) { const components = options.getComponents() if (!regexpMap.has(components)) { @@ -106,7 +106,7 @@ export const TreeShakeTemplatePlugin = createUnplugin((options: TreeShakeTemplat return { code: s.toString(), map: options.sourcemap - ? s.generateMap({ source: id, includeContent: true }) + ? s.generateMap({ hires: true }) : undefined } } @@ -192,7 +192,7 @@ function removeImportDeclaration (ast: Program, importName: string, magicString: * ImportDeclarations and VariableDeclarations are ignored * return the name of the component if is not called */ -function isComponentNotCalledInSetup (codeAst: Node, name: string): string|void { +function isComponentNotCalledInSetup (codeAst: Node, name: string): string | void { if (name) { let found = false walk(codeAst, { diff --git a/packages/nuxt/src/core/plugins/dev-only.ts b/packages/nuxt/src/core/plugins/dev-only.ts index 53e2476e9c..b0c6226cc3 100644 --- a/packages/nuxt/src/core/plugins/dev-only.ts +++ b/packages/nuxt/src/core/plugins/dev-only.ts @@ -23,7 +23,7 @@ export const DevOnlyPlugin = createUnplugin((options: DevOnlyPluginOptions) => { return true } }, - transform (code, id) { + transform (code) { if (!code.match(DEVONLY_COMP_RE)) { return } const s = new MagicString(code) @@ -36,7 +36,7 @@ export const DevOnlyPlugin = createUnplugin((options: DevOnlyPluginOptions) => { return { code: s.toString(), map: options.sourcemap - ? s.generateMap({ source: id, includeContent: true }) + ? s.generateMap({ hires: true }) : undefined } } diff --git a/packages/nuxt/src/core/plugins/layer-aliasing.ts b/packages/nuxt/src/core/plugins/layer-aliasing.ts index 3d72d3a6bf..9c47d65c13 100644 --- a/packages/nuxt/src/core/plugins/layer-aliasing.ts +++ b/packages/nuxt/src/core/plugins/layer-aliasing.ts @@ -60,7 +60,7 @@ export const LayerAliasingPlugin = createUnplugin((options: LayerAliasingOptions if (s.hasChanged()) { return { code: s.toString(), - map: options.sourcemap ? s.generateMap({ source: id, includeContent: true }) : undefined + map: options.sourcemap ? s.generateMap({ hires: true }) : undefined } } } diff --git a/packages/nuxt/src/core/plugins/tree-shake.ts b/packages/nuxt/src/core/plugins/tree-shake.ts index 2539480c37..6b0c3c611b 100644 --- a/packages/nuxt/src/core/plugins/tree-shake.ts +++ b/packages/nuxt/src/core/plugins/tree-shake.ts @@ -35,7 +35,7 @@ export const TreeShakeComposablesPlugin = createUnplugin((options: TreeShakeComp return true } }, - transform (code, id) { + transform (code) { if (!code.match(COMPOSABLE_RE)) { return } const s = new MagicString(code) @@ -48,7 +48,7 @@ export const TreeShakeComposablesPlugin = createUnplugin((options: TreeShakeComp return { code: s.toString(), map: options.sourcemap - ? s.generateMap({ source: id, includeContent: true }) + ? s.generateMap({ hires: true }) : undefined } } diff --git a/packages/nuxt/src/core/plugins/unctx.ts b/packages/nuxt/src/core/plugins/unctx.ts index 042950010c..6a93a72a44 100644 --- a/packages/nuxt/src/core/plugins/unctx.ts +++ b/packages/nuxt/src/core/plugins/unctx.ts @@ -34,7 +34,7 @@ export const UnctxTransformPlugin = createUnplugin((options: UnctxTransformPlugi return true } }, - transform (code, id) { + transform (code) { // TODO: needed for webpack - update transform in unctx/unplugin? if (code.startsWith(TRANSFORM_MARKER) || !transformer.shouldTransform(code)) { return } const result = transformer.transform(code) @@ -42,7 +42,7 @@ export const UnctxTransformPlugin = createUnplugin((options: UnctxTransformPlugi return { code: TRANSFORM_MARKER + result.code, map: options.sourcemap - ? result.magicString.generateMap({ source: id, includeContent: true }) + ? result.magicString.generateMap({ hires: true }) : undefined } } diff --git a/packages/nuxt/src/imports/transform.ts b/packages/nuxt/src/imports/transform.ts index ae353d5605..ab2c08b0af 100644 --- a/packages/nuxt/src/imports/transform.ts +++ b/packages/nuxt/src/imports/transform.ts @@ -49,7 +49,7 @@ export const TransformPlugin = createUnplugin(({ ctx, options, sourcemap }: { ct return { code: s.toString(), map: sourcemap - ? s.generateMap({ source: id, includeContent: true }) + ? s.generateMap({ hires: true }) : undefined } } diff --git a/packages/nuxt/src/pages/page-meta.ts b/packages/nuxt/src/pages/page-meta.ts index 1e2413626c..0852c0198e 100644 --- a/packages/nuxt/src/pages/page-meta.ts +++ b/packages/nuxt/src/pages/page-meta.ts @@ -58,7 +58,7 @@ export const PageMetaPlugin = createUnplugin((options: PageMetaPluginOptions) => return { code: s.toString(), map: options.sourcemap - ? s.generateMap({ source: id, includeContent: true }) + ? s.generateMap({ hires: true }) : undefined } } diff --git a/packages/vite/src/plugins/chunk-error.ts b/packages/vite/src/plugins/chunk-error.ts index a42f19c41d..b63969f53e 100644 --- a/packages/vite/src/plugins/chunk-error.ts +++ b/packages/vite/src/plugins/chunk-error.ts @@ -21,7 +21,7 @@ export const __vitePreload = (...args) => ___vitePreload(...args).catch(err => { return { code: s.toString(), map: options.sourcemap - ? s.generateMap({ source: id, includeContent: true }) + ? s.generateMap({ hires: true }) : undefined } } diff --git a/packages/vite/src/plugins/composable-keys.ts b/packages/vite/src/plugins/composable-keys.ts index 78be8e02a6..70eee4edab 100644 --- a/packages/vite/src/plugins/composable-keys.ts +++ b/packages/vite/src/plugins/composable-keys.ts @@ -86,7 +86,7 @@ export const composableKeysPlugin = createUnplugin((options: ComposableKeysOptio return { code: s.toString(), map: options.sourcemap - ? s.generateMap({ source: id, includeContent: true }) + ? s.generateMap({ hires: true }) : undefined } } diff --git a/packages/vite/src/plugins/paths.ts b/packages/vite/src/plugins/paths.ts index a86667d5c1..f9880b1d44 100644 --- a/packages/vite/src/plugins/paths.ts +++ b/packages/vite/src/plugins/paths.ts @@ -34,7 +34,7 @@ export function runtimePathsPlugin (options: RuntimePathsOptions): Plugin { return { code: s.toString(), map: options.sourcemap - ? s.generateMap({ source: id, includeContent: true }) + ? s.generateMap({ hires: true }) : undefined } } diff --git a/packages/vite/src/plugins/pure-annotations.ts b/packages/vite/src/plugins/pure-annotations.ts index a43b2d8989..3d604dfb8d 100644 --- a/packages/vite/src/plugins/pure-annotations.ts +++ b/packages/vite/src/plugins/pure-annotations.ts @@ -29,7 +29,7 @@ export const pureAnnotationsPlugin = createUnplugin((options: PureAnnotationsOpt return true } }, - transform (code, id) { + transform (code) { if (!FUNCTION_RE_SINGLE.test(code)) { return } const s = new MagicString(code) @@ -43,7 +43,7 @@ export const pureAnnotationsPlugin = createUnplugin((options: PureAnnotationsOpt return { code: s.toString(), map: options.sourcemap - ? s.generateMap({ source: id, includeContent: true }) + ? s.generateMap({ hires: true }) : undefined } } diff --git a/packages/webpack/src/plugins/dynamic-base.ts b/packages/webpack/src/plugins/dynamic-base.ts index eba75dedfe..054afc907e 100644 --- a/packages/webpack/src/plugins/dynamic-base.ts +++ b/packages/webpack/src/plugins/dynamic-base.ts @@ -25,7 +25,7 @@ export const DynamicBasePlugin = createUnplugin((options: DynamicBasePluginOptio return { code: s.toString(), map: options.sourcemap - ? s.generateMap({ source: id, includeContent: true }) + ? s.generateMap({ hires: true }) : undefined } }