Skip to content

Commit

Permalink
feat: set sourcemapIgnoreList to filter out non-source directories (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Apr 11, 2023
1 parent 88f9b1d commit 9aded81
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/grumpy-years-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

feat: set sourcemapIgnoreList to filter out non-source directories
11 changes: 8 additions & 3 deletions packages/kit/src/exports/vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ function kit({ svelte_config }) {

const service_worker_entry_file = resolve_entry(kit.files.serviceWorker);

const sourcemapIgnoreList = /** @param {string} relative_path */ (relative_path) =>
relative_path.includes('node_modules') || relative_path.includes(kit.outDir);

/** @type {import('vite').Plugin} */
const plugin_setup = {
name: 'vite-plugin-sveltekit-setup',
Expand Down Expand Up @@ -231,16 +234,17 @@ function kit({ svelte_config }) {
},
root: cwd,
server: {
cors: { preflightContinue: true },
fs: {
allow: [...allow]
},
sourcemapIgnoreList,
watch: {
ignored: [
// Ignore all siblings of config.kit.outDir/generated
`${posixify(kit.outDir)}/!(generated)`
]
},
cors: { preflightContinue: true }
}
},
preview: {
cors: { preflightContinue: true }
Expand Down Expand Up @@ -563,7 +567,8 @@ function kit({ svelte_config }) {
entryFileNames: ssr ? '[name].js' : `${prefix}/[name].[hash].${ext}`,
chunkFileNames: ssr ? 'chunks/[name].js' : `${prefix}/chunks/[name].[hash].${ext}`,
assetFileNames: `${prefix}/assets/[name].[hash][extname]`,
hoistTransitiveImports: false
hoistTransitiveImports: false,
sourcemapIgnoreList
},
preserveEntrySignatures: 'strict'
},
Expand Down

0 comments on commit 9aded81

Please sign in to comment.