Skip to content

Commit

Permalink
fix: pass solid compiler options to route pages (#1029)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Carniato <ryansolid@gmail.com>
  • Loading branch information
yume-chan and ryansolid authored Aug 29, 2023
1 parent 15650ac commit 63dfdcc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/start/vite/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ function solidStartConfig(options) {
};
}
/**
* @returns {import('node_modules/vite').Plugin}
* @param {{ delay?: number; babel?: any }} options
* @returns {import('vite').Plugin}
* @param {{ delay?: number } & Partial<import("vite-plugin-solid").Options>} options
*/
function solidStartFileSystemRouter(options) {
/** @type {import('./plugin').ViteConfig} */
Expand Down Expand Up @@ -260,7 +260,6 @@ function solidStartFileSystemRouter(options) {
/** @type {string} */ id,
/** @type {any} */ fn
) => {
// @ts-ignore
let plugin = solid({
...(options ?? {}),
ssr: process.env.START_SPA_CLIENT === "true" ? false : true,
Expand Down Expand Up @@ -599,7 +598,7 @@ function expand(target, source = {}, parse = v => v) {

// Avoid recursion
if (parents.includes(key)) {
consola.warn(
console.warn(
`Please avoid recursive environment variables ( loop: ${parents.join(
" > "
)} > ${key} )`
Expand Down Expand Up @@ -635,7 +634,7 @@ const findAny = (path, name, exts = [".js", ".ts", ".jsx", ".tsx", ".mjs", ".mts

/**
* @param {import('./plugin').Options} options
* @returns {import('node_modules/vite').PluginOption[]}
* @returns {import('vite').PluginOption[]}
*/
export default function solidStart(options) {
options = Object.assign(
Expand Down Expand Up @@ -667,7 +666,7 @@ export default function solidStart(options) {

return [
solidStartConfig(options),
solidStartFileSystemRouter({ delay: 500 }),
solidStartFileSystemRouter({ delay: 500, typescript: options.typescript, solid: options.solid }),
!options.ssr && solidStartCsrDev(options),
options.inspect ? inspect({ outDir: join(".solid", "inspect") }) : undefined,
options.experimental.islands ? islands() : undefined,
Expand Down

0 comments on commit 63dfdcc

Please sign in to comment.