Skip to content

Commit 31aa0e3

Browse files
committed
fix: rename vike-pointer => vike:pointer
BREAKING CHANGE: `with { type: 'vike-pointer' }` renamed to `with { type: 'vike:pointer' }`
1 parent 8a90535 commit 31aa0e3

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/headings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
iconGlobe,
1212
iconPlug,
1313
iconMegaphone,
14-
} from '@brillout/docpress' with { type: 'vike-pointer' }
14+
} from '@brillout/docpress' with { type: 'vike:pointer' }
1515
import type {
1616
HeadingDefinition,
1717
Config,

docs/pages/config/+Page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ You can manually mark an import to be a pointer import:
396396
// /pages/+config.ts
397397
// Environment: config
398398
399-
import ssr from './ssr' with { type: 'vike-pointer' }
399+
import ssr from './ssr' with { type: 'vike:pointer' }
400400
console.log(ssr) // import:./ssr:default
401401
```
402402

docs/pages/error/runtime-in-config/+Page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Or this:
4141
// ✅ Allowed: same as defining +title.ts
4242

4343
import type { Config } from 'vike/types'
44-
import title from './title' with { type: 'vike-pointer' }
44+
import title from './title' with { type: 'vike:pointer' }
4545

4646
export default {
4747
title

packages/vike/src/node/vite/plugins/pluginStripPointerImportAttribute.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export { pluginStripPointerImportAttribute }
22

3-
// Strip `with { type: 'vike-pointer' }` import attributes from files transpiled for the
3+
// Strip `with { type: 'vike:pointer' }` import attributes from files transpiled for the
44
// client/server runtime. These attributes are only meaningful at config-time (they tell
55
// Vike to treat the import as a pointer import); leaving them in runtime bundles would
66
// break bundlers/runtimes that don't support unknown import attributes.
@@ -9,8 +9,8 @@ import type { Plugin } from 'vite'
99
import { getMagicString } from '../shared/getMagicString.js'
1010
import '../assertEnvVite.js'
1111

12-
// Match `with { type: 'vike-pointer' }` (with optional whitespace variations)
13-
const runtimeAttrRE = /\bwith\s*\{\s*type\s*:\s*['"]vike-pointer['"]\s*\}/g
12+
// Match `with { type: 'vike:pointer' }` (with optional whitespace variations)
13+
const runtimeAttrRE = /\bwith\s*\{\s*type\s*:\s*['"]vike:pointer['"]\s*\}/g
1414

1515
function pluginStripPointerImportAttribute(): Plugin[] {
1616
return [
@@ -19,7 +19,7 @@ function pluginStripPointerImportAttribute(): Plugin[] {
1919
transform: {
2020
filter: {
2121
code: {
22-
include: 'vike-pointer',
22+
include: 'vike:pointer',
2323
},
2424
},
2525
handler(code, id) {

packages/vike/src/node/vite/shared/resolveVikeConfigInternal/transpileAndExecuteFile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ async function transpileWithEsbuild(
251251
// - vike@0.4.162 started soft-requiring Vike extensions to set the name config.
252252
// - In practice, it seems like it requires some (non-trivial?) refactoring.
253253
isVikeExtensionImport ||
254-
args.with?.['type'] === 'vike-pointer'
254+
args.with?.['type'] === 'vike:pointer'
255255

256256
assertPosixPath(importPathResolved)
257257
// False positive if `importPathOriginal` is a path alias that a) looks like an npm package import and b) resolves outside of `userRootDir` => we then we wrongfully assume that `importPathOriginal` is an npm package import.

0 commit comments

Comments
 (0)