Skip to content

Commit

Permalink
Merge pull request #265 from yume-chan/fix/source-map
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav authored Nov 1, 2023
2 parents a4eee41 + 0bc8d67 commit 48700b3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/nice-houses-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'solid-devtools': minor
---

Output source map from vite plugin
3 changes: 3 additions & 0 deletions examples/vite-plugin-ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,8 @@
"dependencies": {
"solid-devtools": "workspace:^",
"vite-plugin-ssr": "0.4.133"
},
"devDependencies": {
"vite-plugin-inspect": "^0.7.33"
}
}
2 changes: 2 additions & 0 deletions examples/vite-plugin-ssr/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import devtools from 'solid-devtools/vite'
import { defineConfig } from 'vite'
import solid from 'vite-plugin-solid'
import ssr from 'vite-plugin-ssr/plugin'
import inspect from 'vite-plugin-inspect'

export default defineConfig({
plugins: [
Expand All @@ -10,5 +11,6 @@ export default defineConfig({
}),
solid({ ssr: true }),
ssr(),
inspect(),
],
})
5 changes: 4 additions & 1 deletion packages/main/src/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,13 @@ export const devtoolsPlugin = (_options: DevtoolsPluginOptions = {}): PluginOpti
root: projectRoot,
filename: id,
sourceFileName: id,
sourceMaps: true,
plugins,
})

return { code: result?.code ?? source }
if (result) {
return { code: result.code!, map: result.map! }
}
},
}
}
4 changes: 4 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48700b3

Please sign in to comment.