Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass solid compiler options to route pages #1029

Merged
merged 2 commits into from
Aug 29, 2023
Merged
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
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