Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/new-pears-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'vite-plugin-solid': patch
---

Made it so that the plugin gets executed after "esbuild"
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ export default function solidPlugin(options: Partial<Options> = {}): Plugin {

return {
name: 'solid',
enforce: 'pre',

async config(userConfig, { command }) {
// We inject the dev mode only if the user explicitly wants it or if we are in dev (serve) mode
Expand All @@ -196,6 +195,11 @@ export default function solidPlugin(options: Partial<Options> = {}): Plugin {
if (!userConfig.resolve) userConfig.resolve = {};
userConfig.resolve.alias = normalizeAliases(userConfig.resolve && userConfig.resolve.alias);

// Forces "esbuild" to preserve JSX so that we can handle it here
// If "esbuild" is not being used, we don't need to change anything
if (userConfig.esbuild !== false)
userConfig.esbuild = { jsx: 'preserve', ...userConfig.esbuild };

const solidPkgsConfig = await crawlFrameworkPkgs({
viteUserConfig: userConfig,
root: projectRoot || process.cwd(),
Expand Down