File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' sv ' : patch
3+ ---
4+
5+ chore: simplify ` runes ` option
Original file line number Diff line number Diff line change 11import adapter from '@sveltejs/adapter-auto' ;
2- import { relative , sep } from 'node:path' ;
32
43/** @type {import('@sveltejs/kit').Config } */
54const config = {
65 compilerOptions : {
7- // defaults to rune mode for the project, except for `node_modules`. Can be removed in svelte 6.
8- runes : ( { filename } ) => {
9- const relativePath = relative ( import . meta. dirname , filename ) ;
10- const pathSegments = relativePath . toLowerCase ( ) . split ( sep ) ;
11- const isExternalLibrary = pathSegments . includes ( 'node_modules' ) ;
12-
13- return isExternalLibrary ? undefined : true ;
14- }
6+ // Force runes mode for the project, except for libraries. Can be removed in svelte 6.
7+ runes : ( { filename } ) => ( filename . split ( / [ / \\ ] / ) . includes ( 'node_modules' ) ? undefined : true )
158 } ,
169 kit : {
1710 // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
Original file line number Diff line number Diff line change 11import { mdsvex } from 'mdsvex' ;
22import adapter from '@sveltejs/adapter-node' ;
3- import { relative , sep } from 'node:path' ;
43
54/** @type {import('@sveltejs/kit').Config } */
65const config = {
76 compilerOptions : {
8- // defaults to rune mode for the project, except for `node_modules`. Can be removed in svelte 6.
9- runes : ( { filename } ) => {
10- const relativePath = relative ( import . meta. dirname , filename ) ;
11- const pathSegments = relativePath . toLowerCase ( ) . split ( sep ) ;
12- const isExternalLibrary = pathSegments . includes ( 'node_modules' ) ;
13-
14- return isExternalLibrary ? undefined : true ;
15- }
7+ // Force runes mode for the project, except for libraries. Can be removed in svelte 6.
8+ runes : ( { filename } ) => filename . split ( / [ / \\ ] / ) . includes ( 'node_modules' ) ? undefined : true
169 } ,
1710 kit : { adapter : adapter ( ) } ,
1811 preprocess : [ mdsvex ( { extensions : [ '.svx' , '.md' ] } ) ] ,
Original file line number Diff line number Diff line change 11import adapter from '@sveltejs/adapter-auto' ;
2- import { relative , sep } from 'node:path' ;
32
43/** @type {import('@sveltejs/kit').Config } */
54const config = {
65 compilerOptions : {
7- // defaults to rune mode for the project, except for `node_modules`. Can be removed in svelte 6.
8- runes : ( { filename } ) => {
9- const relativePath = relative ( import . meta. dirname , filename ) ;
10- const pathSegments = relativePath . toLowerCase ( ) . split ( sep ) ;
11- const isExternalLibrary = pathSegments . includes ( 'node_modules' ) ;
12-
13- return isExternalLibrary ? undefined : true ;
14- }
6+ // Force runes mode for the project, except for libraries. Can be removed in svelte 6.
7+ runes : ( { filename } ) => ( filename . split ( / [ / \\ ] / ) . includes ( 'node_modules' ) ? undefined : true )
158 } ,
169 kit : {
1710 // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
Original file line number Diff line number Diff line change 11import adapter from '@sveltejs/adapter-auto' ;
2- import { relative , sep } from 'node:path' ;
32
43/** @type {import('@sveltejs/kit').Config } */
54const config = {
65 compilerOptions : {
7- // defaults to rune mode for the project, except for `node_modules`. Can be removed in svelte 6.
8- runes : ( { filename } ) => {
9- const relativePath = relative ( import . meta. dirname , filename ) ;
10- const pathSegments = relativePath . toLowerCase ( ) . split ( sep ) ;
11- const isExternalLibrary = pathSegments . includes ( 'node_modules' ) ;
12-
13- return isExternalLibrary ? undefined : true ;
14- }
6+ // Force runes mode for the project, except for libraries. Can be removed in svelte 6.
7+ runes : ( { filename } ) => ( filename . split ( / [ / \\ ] / ) . includes ( 'node_modules' ) ? undefined : true )
158 } ,
169 kit : {
1710 // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
You can’t perform that action at this time.
0 commit comments