vite-plugin-solid 3.0.0-next.0 → 3.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +56 -29
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +58 -30
- package/dist/esm/index.mjs.map +1 -1
- package/dist/types/src/index.d.ts +3 -8
- package/package.json +7 -6
- package/virtual-solid-manifest.d.ts +5 -0
package/dist/cjs/index.cjs
CHANGED
|
@@ -93,6 +93,14 @@ const runtimePublicPath = '/@solid-refresh';
|
|
|
93
93
|
const runtimeFilePath = require$1.resolve('solid-refresh/dist/solid-refresh.mjs');
|
|
94
94
|
const runtimeCode = fs.readFileSync(runtimeFilePath, 'utf-8');
|
|
95
95
|
const isVite6 = +vite.version.split('.')[0] >= 6;
|
|
96
|
+
const VIRTUAL_MANIFEST_ID = 'virtual:solid-manifest';
|
|
97
|
+
const RESOLVED_VIRTUAL_MANIFEST_ID = '\0' + VIRTUAL_MANIFEST_ID;
|
|
98
|
+
const DEV_MANIFEST_CODE = `export default new Proxy({}, {
|
|
99
|
+
get(_, key) {
|
|
100
|
+
if (typeof key !== "string") return undefined;
|
|
101
|
+
return { file: "/" + key };
|
|
102
|
+
}
|
|
103
|
+
});`;
|
|
96
104
|
|
|
97
105
|
/** Possible options for the extensions property */
|
|
98
106
|
|
|
@@ -127,6 +135,8 @@ function solidPlugin(options = {}) {
|
|
|
127
135
|
let replaceDev = false;
|
|
128
136
|
let projectRoot = process.cwd();
|
|
129
137
|
let isTestMode = false;
|
|
138
|
+
let isBuild = false;
|
|
139
|
+
let base = '/';
|
|
130
140
|
let solidPkgsConfig;
|
|
131
141
|
return {
|
|
132
142
|
name: 'solid',
|
|
@@ -229,13 +239,59 @@ function solidPlugin(options = {}) {
|
|
|
229
239
|
}
|
|
230
240
|
},
|
|
231
241
|
configResolved(config) {
|
|
242
|
+
isBuild = config.command === 'build';
|
|
243
|
+
base = config.base;
|
|
232
244
|
needHmr = config.command === 'serve' && config.mode !== 'production' && options.hot !== false && !options.refresh?.disabled;
|
|
233
245
|
},
|
|
246
|
+
configureServer(server) {
|
|
247
|
+
if (!needHmr) return;
|
|
248
|
+
// When a module has a syntax error, Vite sends the error overlay via
|
|
249
|
+
// WebSocket but the failed import triggers invalidation in solid-refresh.
|
|
250
|
+
// This propagates up to @refresh reload boundaries (e.g. document-level
|
|
251
|
+
// App components in SSR), causing a full-reload that overrides the overlay.
|
|
252
|
+
// We suppress update/full-reload messages that immediately follow an error.
|
|
253
|
+
const hot = server.hot ?? server.ws;
|
|
254
|
+
if (!hot) return;
|
|
255
|
+
let lastErrorTime = 0;
|
|
256
|
+
const origSend = hot.send.bind(hot);
|
|
257
|
+
hot.send = function (...args) {
|
|
258
|
+
const payload = args[0];
|
|
259
|
+
if (typeof payload === 'object' && payload) {
|
|
260
|
+
if (payload.type === 'error') {
|
|
261
|
+
lastErrorTime = Date.now();
|
|
262
|
+
} else if (lastErrorTime && (payload.type === 'full-reload' || payload.type === 'update')) {
|
|
263
|
+
if (Date.now() - lastErrorTime < 200) return;
|
|
264
|
+
lastErrorTime = 0;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
return origSend(...args);
|
|
268
|
+
};
|
|
269
|
+
},
|
|
270
|
+
hotUpdate() {
|
|
271
|
+
// solid-refresh only injects HMR boundaries into client modules, so
|
|
272
|
+
// non-client environments have no accept handlers. Without this, Vite
|
|
273
|
+
// would see no boundaries and send full-reload messages that race with
|
|
274
|
+
// client-side HMR updates.
|
|
275
|
+
if (this.environment.name !== 'client') {
|
|
276
|
+
return [];
|
|
277
|
+
}
|
|
278
|
+
},
|
|
234
279
|
resolveId(id) {
|
|
235
280
|
if (id === runtimePublicPath) return id;
|
|
281
|
+
if (id === VIRTUAL_MANIFEST_ID) return RESOLVED_VIRTUAL_MANIFEST_ID;
|
|
236
282
|
},
|
|
237
283
|
load(id) {
|
|
238
284
|
if (id === runtimePublicPath) return runtimeCode;
|
|
285
|
+
if (id === RESOLVED_VIRTUAL_MANIFEST_ID) {
|
|
286
|
+
if (!isBuild) return DEV_MANIFEST_CODE;
|
|
287
|
+
const manifestPath = path.resolve(projectRoot, 'dist/client/.vite/manifest.json');
|
|
288
|
+
if (fs.existsSync(manifestPath)) {
|
|
289
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
|
|
290
|
+
manifest._base = base;
|
|
291
|
+
return `export default ${JSON.stringify(manifest)};`;
|
|
292
|
+
}
|
|
293
|
+
return DEV_MANIFEST_CODE;
|
|
294
|
+
}
|
|
239
295
|
},
|
|
240
296
|
async transform(source, id, transformOptions) {
|
|
241
297
|
const isSsr = transformOptions && transformOptions.ssr;
|
|
@@ -370,35 +426,6 @@ function normalizeAliases(alias = []) {
|
|
|
370
426
|
replacement
|
|
371
427
|
}));
|
|
372
428
|
}
|
|
373
|
-
let _manifest;
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Returns the Vite asset manifest for SSR.
|
|
377
|
-
* In production, reads and caches the manifest JSON from `manifestPath`.
|
|
378
|
-
* In development (file not found), returns a proxy that maps each moduleUrl
|
|
379
|
-
* to its dev server path, so lazy() asset resolution works without a build.
|
|
380
|
-
*/
|
|
381
|
-
function getManifest(manifestPath) {
|
|
382
|
-
if (_manifest) return _manifest;
|
|
383
|
-
if (manifestPath) {
|
|
384
|
-
try {
|
|
385
|
-
_manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8'));
|
|
386
|
-
return _manifest;
|
|
387
|
-
} catch {
|
|
388
|
-
// File doesn't exist — dev mode, fall through
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
_manifest = new Proxy({}, {
|
|
392
|
-
get(_, key) {
|
|
393
|
-
if (typeof key !== 'string') return undefined;
|
|
394
|
-
return {
|
|
395
|
-
file: '/' + key
|
|
396
|
-
};
|
|
397
|
-
}
|
|
398
|
-
});
|
|
399
|
-
return _manifest;
|
|
400
|
-
}
|
|
401
429
|
|
|
402
430
|
exports.default = solidPlugin;
|
|
403
|
-
exports.getManifest = getManifest;
|
|
404
431
|
//# sourceMappingURL=index.cjs.map
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/lazy-module-url.ts","../../src/index.ts"],"sourcesContent":["import type { PluginObj, types as t } from '@babel/core';\n\nexport const LAZY_PLACEHOLDER_PREFIX = '__SOLID_LAZY_MODULE__:';\n\n/**\n * Detects whether a CallExpression argument is `() => import(\"specifier\")`\n * and returns the specifier string if so.\n */\nfunction extractDynamicImportSpecifier(node: t.Node): string | null {\n if (node.type !== 'ArrowFunctionExpression' && node.type !== 'FunctionExpression') return null;\n\n let callExpr: t.CallExpression | null = null;\n if (node.body.type === 'CallExpression') {\n callExpr = node.body;\n } else if (\n node.body.type === 'BlockStatement' &&\n node.body.body.length === 1 &&\n node.body.body[0].type === 'ReturnStatement' &&\n node.body.body[0].argument?.type === 'CallExpression'\n ) {\n callExpr = node.body.body[0].argument;\n }\n if (!callExpr) return null;\n\n if (callExpr.callee.type !== 'Import') return null;\n if (callExpr.arguments.length !== 1) return null;\n\n const arg = callExpr.arguments[0];\n if (arg.type !== 'StringLiteral') return null;\n\n return arg.value;\n}\n\n/**\n * Babel plugin that detects `lazy(() => import(\"specifier\"))` calls\n * and injects a placeholder as the second argument. The placeholder\n * is resolved to a real path by the Vite transform hook using this.resolve().\n */\nexport default function lazyModuleUrlPlugin(): PluginObj {\n return {\n name: 'solid-lazy-module-url',\n visitor: {\n CallExpression(nodePath, state) {\n if (!state.filename) return;\n const { node } = nodePath;\n\n if (node.callee.type !== 'Identifier' || node.callee.name !== 'lazy') return;\n\n const binding = nodePath.scope.getBinding('lazy');\n if (!binding || binding.kind !== 'module') return;\n const bindingPath = binding.path;\n if (\n bindingPath.type !== 'ImportSpecifier' ||\n bindingPath.parent.type !== 'ImportDeclaration'\n )\n return;\n const source = (bindingPath.parent as t.ImportDeclaration).source.value;\n if (source !== 'solid-js') return;\n\n if (node.arguments.length >= 2) return;\n if (node.arguments.length !== 1) return;\n\n const specifier = extractDynamicImportSpecifier(node.arguments[0] as t.Node);\n if (!specifier) return;\n\n node.arguments.push({\n type: 'StringLiteral',\n value: LAZY_PLACEHOLDER_PREFIX + specifier,\n } as t.StringLiteral);\n },\n },\n };\n}\n","import * as babel from '@babel/core';\nimport solid from 'babel-preset-solid';\nimport { readFileSync } from 'fs';\nimport { mergeAndConcat } from 'merge-anything';\nimport { createRequire } from 'module';\nimport solidRefresh from 'solid-refresh/babel';\n// TODO use proper path\nimport type { Options as RefreshOptions } from 'solid-refresh/babel';\nimport lazyModuleUrl, { LAZY_PLACEHOLDER_PREFIX } from './lazy-module-url.js';\nimport path from 'path';\nimport type { Alias, AliasOptions, FilterPattern, Plugin } from 'vite';\nimport { createFilter, version } from 'vite';\nimport { crawlFrameworkPkgs } from 'vitefu';\n\nconst require = createRequire(import.meta.url);\n\nconst runtimePublicPath = '/@solid-refresh';\nconst runtimeFilePath = require.resolve('solid-refresh/dist/solid-refresh.mjs');\nconst runtimeCode = readFileSync(runtimeFilePath, 'utf-8');\n\nconst isVite6 = +version.split('.')[0] >= 6;\n\n/** Possible options for the extensions property */\nexport interface ExtensionOptions {\n typescript?: boolean;\n}\n\n/** Configuration options for vite-plugin-solid. */\nexport interface Options {\n /**\n * A [picomatch](https://github.com/micromatch/picomatch) pattern, or array of patterns, which specifies the files\n * the plugin should operate on.\n */\n include?: FilterPattern;\n /**\n * A [picomatch](https://github.com/micromatch/picomatch) pattern, or array of patterns, which specifies the files\n * to be ignored by the plugin.\n */\n exclude?: FilterPattern;\n /**\n * This will inject solid-js/dev in place of solid-js in dev mode. Has no\n * effect in prod. If set to `false`, it won't inject it in dev. This is\n * useful for extra logs and debugging.\n *\n * @default true\n */\n dev?: boolean;\n /**\n * This will force SSR code in the produced files.\n *\n * @default false\n */\n ssr?: boolean;\n\n /**\n * This will inject HMR runtime in dev mode. Has no effect in prod. If\n * set to `false`, it won't inject the runtime in dev.\n *\n * @default true\n * @deprecated use `refresh` instead\n */\n hot?: boolean;\n /**\n * This registers additional extensions that should be processed by\n * vite-plugin-solid.\n *\n * @default undefined\n */\n extensions?: (string | [string, ExtensionOptions])[];\n /**\n * Pass any additional babel transform options. They will be merged with\n * the transformations required by Solid.\n *\n * @default {}\n */\n babel?:\n | babel.TransformOptions\n | ((source: string, id: string, ssr: boolean) => babel.TransformOptions)\n | ((source: string, id: string, ssr: boolean) => Promise<babel.TransformOptions>);\n /**\n * Pass any additional [babel-plugin-jsx-dom-expressions](https://github.com/ryansolid/dom-expressions/tree/main/packages/babel-plugin-jsx-dom-expressions#plugin-options).\n * They will be merged with the defaults sets by [babel-preset-solid](https://github.com/solidjs/solid/blob/main/packages/babel-preset-solid/index.js#L8-L25).\n *\n * @default {}\n */\n solid?: {\n /**\n * Remove unnecessary closing tags from template strings. More info here:\n * https://github.com/solidjs/solid/blob/main/CHANGELOG.md#smaller-templates\n *\n * @default false\n */\n omitNestedClosingTags?: boolean;\n\n /**\n * Remove the last closing tag from template strings. Enabled by default even when `omitNestedClosingTags` is disabled.\n * Can be disabled for compatibility for some browser-like environments.\n *\n * @default true\n */\n omitLastClosingTag?: boolean;\n\n /**\n * Remove unnecessary quotes from template strings.\n * Can be disabled for compatibility for some browser-like environments.\n *\n * @default true\n */\n omitQuotes?: boolean;\n\n /**\n * The name of the runtime module to import the methods from.\n *\n * @default \"solid-js/web\"\n */\n moduleName?: string;\n\n /**\n * The output mode of the compiler.\n * Can be:\n * - \"dom\" is standard output\n * - \"ssr\" is for server side rendering of strings.\n * - \"universal\" is for using custom renderers from solid-js/universal\n *\n * @default \"dom\"\n */\n generate?: 'ssr' | 'dom' | 'universal';\n\n /**\n * Indicate whether the output should contain hydratable markers.\n *\n * @default false\n */\n hydratable?: boolean;\n\n /**\n * Boolean to indicate whether to enable automatic event delegation on camelCase.\n *\n * @default true\n */\n delegateEvents?: boolean;\n\n /**\n * Boolean indicates whether smart conditional detection should be used.\n * This optimizes simple boolean expressions and ternaries in JSX.\n *\n * @default true\n */\n wrapConditionals?: boolean;\n\n /**\n * Boolean indicates whether to set current render context on Custom Elements and slots.\n * Useful for seemless Context API with Web Components.\n *\n * @default true\n */\n contextToCustomElements?: boolean;\n\n /**\n * Array of Component exports from module, that aren't included by default with the library.\n * This plugin will automatically import them if it comes across them in the JSX.\n *\n * @default [\"For\",\"Show\",\"Switch\",\"Match\",\"Suspense\",\"SuspenseList\",\"Portal\",\"Index\",\"Dynamic\",\"ErrorBoundary\"]\n */\n builtIns?: string[];\n\n /**\n * Enable dev-mode compilation output. When true, the compiler emits\n * additional runtime checks (e.g. hydration mismatch assertions).\n * Automatically set to true during `vite dev` — override here to\n * force on or off.\n *\n * @default auto (true in dev, false in build)\n */\n dev?: boolean;\n };\n\n\n refresh: Omit<RefreshOptions & { disabled: boolean }, 'bundler' | 'fixRender' | 'jsx'>;\n}\n\nfunction getExtension(filename: string): string {\n const index = filename.lastIndexOf('.');\n return index < 0 ? '' : filename.substring(index).replace(/\\?.+$/, '');\n}\nfunction containsSolidField(fields: Record<string, any>) {\n const keys = Object.keys(fields);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (key === 'solid') return true;\n if (typeof fields[key] === 'object' && fields[key] != null && containsSolidField(fields[key]))\n return true;\n }\n return false;\n}\n\nfunction getJestDomExport(setupFiles: string[]) {\n return setupFiles?.some((path) => /jest-dom/.test(path))\n ? undefined\n : ['@testing-library/jest-dom/vitest', '@testing-library/jest-dom/extend-expect'].find(\n (path) => {\n try {\n require.resolve(path);\n return true;\n } catch (e) {\n return false;\n }\n },\n );\n}\n\nexport default function solidPlugin(options: Partial<Options> = {}): Plugin {\n const filter = createFilter(options.include, options.exclude);\n\n let needHmr = false;\n let replaceDev = false;\n let projectRoot = process.cwd();\n let isTestMode = false;\n let solidPkgsConfig: Awaited<ReturnType<typeof crawlFrameworkPkgs>>;\n\n return {\n name: 'solid',\n enforce: 'pre',\n\n async config(userConfig, { command }) {\n // We inject the dev mode only if the user explicitly wants it or if we are in dev (serve) mode\n replaceDev = options.dev === true || (options.dev !== false && command === 'serve');\n projectRoot = userConfig.root || projectRoot;\n isTestMode = userConfig.mode === 'test';\n\n if (!userConfig.resolve) userConfig.resolve = {};\n userConfig.resolve.alias = normalizeAliases(userConfig.resolve && userConfig.resolve.alias);\n\n solidPkgsConfig = await crawlFrameworkPkgs({\n viteUserConfig: userConfig,\n root: projectRoot || process.cwd(),\n isBuild: command === 'build',\n isFrameworkPkgByJson(pkgJson) {\n return containsSolidField(pkgJson.exports || {});\n },\n });\n\n // fix for bundling dev in production\n const nestedDeps = replaceDev\n ? ['solid-js', '@solidjs/web']\n : [];\n\n const userTest = (userConfig as any).test ?? {};\n const test = {} as any;\n if (userConfig.mode === 'test') {\n // to simplify the processing of the config, we normalize the setupFiles to an array\n const userSetupFiles: string[] =\n typeof userTest.setupFiles === 'string'\n ? [userTest.setupFiles]\n : userTest.setupFiles || [];\n\n if (!userTest.environment && !options.ssr) {\n test.environment = 'jsdom';\n }\n\n if (\n !userTest.server?.deps?.external?.find((item: string | RegExp) =>\n /solid-js/.test(item.toString()),\n )\n ) {\n test.server = { deps: { external: [/solid-js/] } };\n }\n if (!userTest.browser?.enabled) {\n // vitest browser mode already has bundled jest-dom assertions\n // https://main.vitest.dev/guide/browser/assertion-api.html#assertion-api\n const jestDomImport = getJestDomExport(userSetupFiles);\n if (jestDomImport) {\n test.setupFiles = [jestDomImport];\n }\n }\n }\n\n return {\n /**\n * We only need esbuild on .ts or .js files.\n * .tsx & .jsx files are handled by us\n */\n // esbuild: { include: /\\.ts$/ },\n resolve: {\n conditions: isVite6\n ? undefined\n : [\n 'solid',\n ...(replaceDev ? ['development'] : []),\n ...(userConfig.mode === 'test' && !options.ssr ? ['browser'] : []),\n ],\n dedupe: nestedDeps,\n alias: [{ find: /^solid-refresh$/, replacement: runtimePublicPath }],\n },\n optimizeDeps: {\n include: [...nestedDeps, ...solidPkgsConfig.optimizeDeps.include],\n exclude: solidPkgsConfig.optimizeDeps.exclude,\n },\n ...(!isVite6 ? { ssr: solidPkgsConfig.ssr } : {}),\n ...(test.server ? { test } : {}),\n };\n },\n\n // @ts-ignore This hook only works in Vite 6\n async configEnvironment(name, config, opts) {\n config.resolve ??= {};\n // Emulate Vite default fallback for `resolve.conditions` if not set\n if (config.resolve.conditions == null) {\n // @ts-ignore These exports only exist in Vite 6\n const { defaultClientConditions, defaultServerConditions } = await import('vite');\n if (config.consumer === 'client' || name === 'client' || opts.isSsrTargetWebworker) {\n config.resolve.conditions = [...defaultClientConditions];\n } else {\n config.resolve.conditions = [...defaultServerConditions];\n }\n }\n config.resolve.conditions = [\n 'solid',\n ...(replaceDev ? ['development'] : []),\n ...(isTestMode && !opts.isSsrTargetWebworker && !options.ssr ? ['browser'] : []),\n ...config.resolve.conditions,\n ];\n\n // Set resolve.noExternal and resolve.external for SSR environment (Vite 6+)\n // Only set resolve.external if noExternal is not true (to avoid conflicts with plugins like Cloudflare)\n if (isVite6 && name === 'ssr' && solidPkgsConfig) {\n if (config.resolve.noExternal !== true) {\n config.resolve.noExternal = [\n ...(Array.isArray(config.resolve.noExternal) ? config.resolve.noExternal : []),\n ...solidPkgsConfig.ssr.noExternal,\n ];\n config.resolve.external = [\n ...(Array.isArray(config.resolve.external) ? config.resolve.external : []),\n ...solidPkgsConfig.ssr.external,\n ];\n }\n }\n },\n\n configResolved(config) {\n needHmr = config.command === 'serve' && config.mode !== 'production' && (options.hot !== false && !options.refresh?.disabled);\n },\n\n resolveId(id) {\n if (id === runtimePublicPath) return id;\n },\n\n load(id) {\n if (id === runtimePublicPath) return runtimeCode;\n },\n\n async transform(source, id, transformOptions) {\n const isSsr = transformOptions && transformOptions.ssr;\n const currentFileExtension = getExtension(id);\n\n const extensionsToWatch = options.extensions || [];\n const allExtensions = extensionsToWatch.map((extension) =>\n // An extension can be a string or a tuple [extension, options]\n typeof extension === 'string' ? extension : extension[0],\n );\n\n if (!filter(id)) {\n return null;\n }\n\n id = id.replace(/\\?.*$/, '');\n\n if (!(/\\.[mc]?[tj]sx$/i.test(id) || allExtensions.includes(currentFileExtension))) {\n return null;\n }\n\n const inNodeModules = /node_modules/.test(id);\n\n let solidOptions: { generate: 'ssr' | 'dom'; hydratable: boolean };\n\n if (options.ssr) {\n if (isSsr) {\n solidOptions = { generate: 'ssr', hydratable: true };\n } else {\n solidOptions = { generate: 'dom', hydratable: true };\n }\n } else {\n solidOptions = { generate: 'dom', hydratable: false };\n }\n\n // We need to know if the current file extension has a typescript options tied to it\n const shouldBeProcessedWithTypescript =\n /\\.[mc]?tsx$/i.test(id) ||\n extensionsToWatch.some((extension) => {\n if (typeof extension === 'string') {\n return extension.includes('tsx');\n }\n\n const [extensionName, extensionOptions] = extension;\n if (extensionName !== currentFileExtension) return false;\n\n return extensionOptions.typescript;\n });\n const plugins: NonNullable<NonNullable<babel.TransformOptions['parserOpts']>['plugins']> = [\n 'jsx',\n 'decorators',\n ];\n\n if (shouldBeProcessedWithTypescript) {\n plugins.push('typescript');\n }\n\n const opts: babel.TransformOptions = {\n root: projectRoot,\n filename: id,\n sourceFileName: id,\n presets: [[solid, { ...solidOptions, dev: replaceDev, ...(options.solid || {}) }]],\n plugins: [\n [lazyModuleUrl],\n ...(needHmr && !isSsr && !inNodeModules ? [[solidRefresh, {\n ...(options.refresh || {}),\n bundler: 'vite',\n fixRender: true,\n // TODO unfortunately, even with SSR enabled for refresh\n // it still doesn't work, so now we have to disable\n // this config\n jsx: false,\n }]] : []),\n ],\n ast: false,\n sourceMaps: true,\n configFile: false,\n babelrc: false,\n parserOpts: {\n plugins,\n },\n };\n\n // Default value for babel user options\n let babelUserOptions: babel.TransformOptions = {};\n\n if (options.babel) {\n if (typeof options.babel === 'function') {\n const babelOptions = options.babel(source, id, !!isSsr);\n babelUserOptions = babelOptions instanceof Promise ? await babelOptions : babelOptions;\n } else {\n babelUserOptions = options.babel;\n }\n }\n\n const babelOptions = mergeAndConcat(babelUserOptions, opts) as babel.TransformOptions;\n\n const result = await babel.transformAsync(source, babelOptions);\n if (!result) {\n return undefined;\n }\n\n let code = result.code || '';\n\n // Resolve lazy() moduleUrl placeholders using Vite's resolver\n const placeholderRe = new RegExp(\n '\"' + LAZY_PLACEHOLDER_PREFIX + '([^\"]+)\"',\n 'g',\n );\n let match;\n const resolutions: Array<{ placeholder: string; resolved: string }> = [];\n while ((match = placeholderRe.exec(code)) !== null) {\n const specifier = match[1];\n const resolved = await this.resolve(specifier, id);\n if (resolved) {\n const cleanId = resolved.id.split('?')[0];\n resolutions.push({\n placeholder: match[0],\n resolved: '\"' + path.relative(projectRoot, cleanId) + '\"',\n });\n }\n }\n for (const { placeholder, resolved } of resolutions) {\n code = code.replace(placeholder, resolved);\n }\n\n return { code, map: result.map };\n },\n };\n}\n\n/**\n * This basically normalize all aliases of the config into\n * the array format of the alias.\n *\n * eg: alias: { '@': 'src/' } => [{ find: '@', replacement: 'src/' }]\n */\nfunction normalizeAliases(alias: AliasOptions = []): Alias[] {\n return Array.isArray(alias)\n ? alias\n : Object.entries(alias).map(([find, replacement]) => ({ find, replacement }));\n}\n\nexport type ViteManifest = Record<\n string,\n {\n file: string;\n css?: string[];\n isEntry?: boolean;\n isDynamicEntry?: boolean;\n imports?: string[];\n }\n>;\n\nlet _manifest: ViteManifest | undefined;\n\n/**\n * Returns the Vite asset manifest for SSR.\n * In production, reads and caches the manifest JSON from `manifestPath`.\n * In development (file not found), returns a proxy that maps each moduleUrl\n * to its dev server path, so lazy() asset resolution works without a build.\n */\nexport function getManifest(manifestPath?: string): ViteManifest {\n if (_manifest) return _manifest;\n if (manifestPath) {\n try {\n _manifest = JSON.parse(readFileSync(manifestPath, 'utf-8'));\n return _manifest!;\n } catch {\n // File doesn't exist — dev mode, fall through\n }\n }\n _manifest = new Proxy(\n {},\n {\n get(_, key) {\n if (typeof key !== 'string') return undefined;\n return { file: '/' + key };\n },\n },\n ) as ViteManifest;\n return _manifest;\n}\n"],"names":["LAZY_PLACEHOLDER_PREFIX","extractDynamicImportSpecifier","node","type","callExpr","body","length","argument","callee","arguments","arg","value","lazyModuleUrlPlugin","name","visitor","CallExpression","nodePath","state","filename","binding","scope","getBinding","kind","bindingPath","path","parent","source","specifier","push","require","createRequire","import","runtimePublicPath","runtimeFilePath","resolve","runtimeCode","readFileSync","isVite6","version","split","getExtension","index","lastIndexOf","substring","replace","containsSolidField","fields","keys","Object","i","key","getJestDomExport","setupFiles","some","test","undefined","find","e","solidPlugin","options","filter","createFilter","include","exclude","needHmr","replaceDev","projectRoot","process","cwd","isTestMode","solidPkgsConfig","enforce","config","userConfig","command","dev","root","mode","alias","normalizeAliases","crawlFrameworkPkgs","viteUserConfig","isBuild","isFrameworkPkgByJson","pkgJson","exports","nestedDeps","userTest","userSetupFiles","environment","ssr","server","deps","external","item","toString","browser","enabled","jestDomImport","conditions","dedupe","replacement","optimizeDeps","configEnvironment","opts","defaultClientConditions","defaultServerConditions","consumer","isSsrTargetWebworker","noExternal","Array","isArray","configResolved","hot","refresh","disabled","resolveId","id","load","transform","transformOptions","isSsr","currentFileExtension","extensionsToWatch","extensions","allExtensions","map","extension","includes","inNodeModules","solidOptions","generate","hydratable","shouldBeProcessedWithTypescript","extensionName","extensionOptions","typescript","plugins","sourceFileName","presets","solid","lazyModuleUrl","solidRefresh","bundler","fixRender","jsx","ast","sourceMaps","configFile","babelrc","parserOpts","babelUserOptions","babel","babelOptions","Promise","mergeAndConcat","result","transformAsync","code","placeholderRe","RegExp","match","resolutions","exec","resolved","cleanId","placeholder","relative","entries","_manifest","getManifest","manifestPath","JSON","parse","Proxy","get","_","file"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAMA,uBAAuB,GAAG,wBAAwB;;AAE/D;AACA;AACA;AACA;AACA,SAASC,6BAA6BA,CAACC,IAAY,EAAiB;AAClE,EAAA,IAAIA,IAAI,CAACC,IAAI,KAAK,yBAAyB,IAAID,IAAI,CAACC,IAAI,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qB,EAAgB;EAC/D,IAAIF,SAAS,EAAE,OAAOA,SAAS;AAC/B,EAAA,IAAIE,YAAY,EAAE;IAChB,IAAI;MACFF,SAAS,GAAGG,IAAI,CAACC,KAAK,CAACzI,eAAY,CAACuI,YAAY,EAAE,OAAO,CAAC,CAAC;AAC3D,MAAA,OAAOF,SAAS;AAClB,KAAC,CAAC,MAAM;AACN;AAAA;AAEJ;AACAA,EAAAA,SAAS,GAAG,IAAIK,KAAK,CACnB,EAAE,EACF;AACEC,IAAAA,GAAGA,CAACC,CAAC,EAAE9H,GAAG,EAAE;AACV,MAAA,IAAI,OAAOA,GAAG,KAAK,QAAQ,EAAE,OAAOK,SAAS;MAC7C,OAAO;QAAE0H,IAAI,EAAE,GAAG,GAAG/H;OAAK;AAC5B;AACF,GACF,CAAiB;AACjB,EAAA,OAAOuH,SAAS;AAClB;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/lazy-module-url.ts","../../src/index.ts"],"sourcesContent":["import type { PluginObj, types as t } from '@babel/core';\n\nexport const LAZY_PLACEHOLDER_PREFIX = '__SOLID_LAZY_MODULE__:';\n\n/**\n * Detects whether a CallExpression argument is `() => import(\"specifier\")`\n * and returns the specifier string if so.\n */\nfunction extractDynamicImportSpecifier(node: t.Node): string | null {\n if (node.type !== 'ArrowFunctionExpression' && node.type !== 'FunctionExpression') return null;\n\n let callExpr: t.CallExpression | null = null;\n if (node.body.type === 'CallExpression') {\n callExpr = node.body;\n } else if (\n node.body.type === 'BlockStatement' &&\n node.body.body.length === 1 &&\n node.body.body[0].type === 'ReturnStatement' &&\n node.body.body[0].argument?.type === 'CallExpression'\n ) {\n callExpr = node.body.body[0].argument;\n }\n if (!callExpr) return null;\n\n if (callExpr.callee.type !== 'Import') return null;\n if (callExpr.arguments.length !== 1) return null;\n\n const arg = callExpr.arguments[0];\n if (arg.type !== 'StringLiteral') return null;\n\n return arg.value;\n}\n\n/**\n * Babel plugin that detects `lazy(() => import(\"specifier\"))` calls\n * and injects a placeholder as the second argument. The placeholder\n * is resolved to a real path by the Vite transform hook using this.resolve().\n */\nexport default function lazyModuleUrlPlugin(): PluginObj {\n return {\n name: 'solid-lazy-module-url',\n visitor: {\n CallExpression(nodePath, state) {\n if (!state.filename) return;\n const { node } = nodePath;\n\n if (node.callee.type !== 'Identifier' || node.callee.name !== 'lazy') return;\n\n const binding = nodePath.scope.getBinding('lazy');\n if (!binding || binding.kind !== 'module') return;\n const bindingPath = binding.path;\n if (\n bindingPath.type !== 'ImportSpecifier' ||\n bindingPath.parent.type !== 'ImportDeclaration'\n )\n return;\n const source = (bindingPath.parent as t.ImportDeclaration).source.value;\n if (source !== 'solid-js') return;\n\n if (node.arguments.length >= 2) return;\n if (node.arguments.length !== 1) return;\n\n const specifier = extractDynamicImportSpecifier(node.arguments[0] as t.Node);\n if (!specifier) return;\n\n node.arguments.push({\n type: 'StringLiteral',\n value: LAZY_PLACEHOLDER_PREFIX + specifier,\n } as t.StringLiteral);\n },\n },\n };\n}\n","import * as babel from '@babel/core';\nimport solid from 'babel-preset-solid';\nimport { existsSync, readFileSync } from 'fs';\nimport { mergeAndConcat } from 'merge-anything';\nimport { createRequire } from 'module';\nimport solidRefresh from 'solid-refresh/babel';\n// TODO use proper path\nimport type { Options as RefreshOptions } from 'solid-refresh/babel';\nimport lazyModuleUrl, { LAZY_PLACEHOLDER_PREFIX } from './lazy-module-url.js';\nimport path from 'path';\nimport type { Alias, AliasOptions, FilterPattern, Plugin } from 'vite';\nimport { createFilter, version } from 'vite';\nimport { crawlFrameworkPkgs } from 'vitefu';\n\nconst require = createRequire(import.meta.url);\n\nconst runtimePublicPath = '/@solid-refresh';\nconst runtimeFilePath = require.resolve('solid-refresh/dist/solid-refresh.mjs');\nconst runtimeCode = readFileSync(runtimeFilePath, 'utf-8');\n\nconst isVite6 = +version.split('.')[0] >= 6;\n\nconst VIRTUAL_MANIFEST_ID = 'virtual:solid-manifest';\nconst RESOLVED_VIRTUAL_MANIFEST_ID = '\\0' + VIRTUAL_MANIFEST_ID;\n\nconst DEV_MANIFEST_CODE = `export default new Proxy({}, {\n get(_, key) {\n if (typeof key !== \"string\") return undefined;\n return { file: \"/\" + key };\n }\n});`;\n\n/** Possible options for the extensions property */\nexport interface ExtensionOptions {\n typescript?: boolean;\n}\n\n/** Configuration options for vite-plugin-solid. */\nexport interface Options {\n /**\n * A [picomatch](https://github.com/micromatch/picomatch) pattern, or array of patterns, which specifies the files\n * the plugin should operate on.\n */\n include?: FilterPattern;\n /**\n * A [picomatch](https://github.com/micromatch/picomatch) pattern, or array of patterns, which specifies the files\n * to be ignored by the plugin.\n */\n exclude?: FilterPattern;\n /**\n * This will inject solid-js/dev in place of solid-js in dev mode. Has no\n * effect in prod. If set to `false`, it won't inject it in dev. This is\n * useful for extra logs and debugging.\n *\n * @default true\n */\n dev?: boolean;\n /**\n * This will force SSR code in the produced files.\n *\n * @default false\n */\n ssr?: boolean;\n\n /**\n * This will inject HMR runtime in dev mode. Has no effect in prod. If\n * set to `false`, it won't inject the runtime in dev.\n *\n * @default true\n * @deprecated use `refresh` instead\n */\n hot?: boolean;\n /**\n * This registers additional extensions that should be processed by\n * vite-plugin-solid.\n *\n * @default undefined\n */\n extensions?: (string | [string, ExtensionOptions])[];\n /**\n * Pass any additional babel transform options. They will be merged with\n * the transformations required by Solid.\n *\n * @default {}\n */\n babel?:\n | babel.TransformOptions\n | ((source: string, id: string, ssr: boolean) => babel.TransformOptions)\n | ((source: string, id: string, ssr: boolean) => Promise<babel.TransformOptions>);\n /**\n * Pass any additional [babel-plugin-jsx-dom-expressions](https://github.com/ryansolid/dom-expressions/tree/main/packages/babel-plugin-jsx-dom-expressions#plugin-options).\n * They will be merged with the defaults sets by [babel-preset-solid](https://github.com/solidjs/solid/blob/main/packages/babel-preset-solid/index.js#L8-L25).\n *\n * @default {}\n */\n solid?: {\n /**\n * Remove unnecessary closing tags from template strings. More info here:\n * https://github.com/solidjs/solid/blob/main/CHANGELOG.md#smaller-templates\n *\n * @default false\n */\n omitNestedClosingTags?: boolean;\n\n /**\n * Remove the last closing tag from template strings. Enabled by default even when `omitNestedClosingTags` is disabled.\n * Can be disabled for compatibility for some browser-like environments.\n *\n * @default true\n */\n omitLastClosingTag?: boolean;\n\n /**\n * Remove unnecessary quotes from template strings.\n * Can be disabled for compatibility for some browser-like environments.\n *\n * @default true\n */\n omitQuotes?: boolean;\n\n /**\n * The name of the runtime module to import the methods from.\n *\n * @default \"solid-js/web\"\n */\n moduleName?: string;\n\n /**\n * The output mode of the compiler.\n * Can be:\n * - \"dom\" is standard output\n * - \"ssr\" is for server side rendering of strings.\n * - \"universal\" is for using custom renderers from solid-js/universal\n *\n * @default \"dom\"\n */\n generate?: 'ssr' | 'dom' | 'universal';\n\n /**\n * Indicate whether the output should contain hydratable markers.\n *\n * @default false\n */\n hydratable?: boolean;\n\n /**\n * Boolean to indicate whether to enable automatic event delegation on camelCase.\n *\n * @default true\n */\n delegateEvents?: boolean;\n\n /**\n * Boolean indicates whether smart conditional detection should be used.\n * This optimizes simple boolean expressions and ternaries in JSX.\n *\n * @default true\n */\n wrapConditionals?: boolean;\n\n /**\n * Boolean indicates whether to set current render context on Custom Elements and slots.\n * Useful for seemless Context API with Web Components.\n *\n * @default true\n */\n contextToCustomElements?: boolean;\n\n /**\n * Array of Component exports from module, that aren't included by default with the library.\n * This plugin will automatically import them if it comes across them in the JSX.\n *\n * @default [\"For\",\"Show\",\"Switch\",\"Match\",\"Suspense\",\"SuspenseList\",\"Portal\",\"Index\",\"Dynamic\",\"ErrorBoundary\"]\n */\n builtIns?: string[];\n\n /**\n * Enable dev-mode compilation output. When true, the compiler emits\n * additional runtime checks (e.g. hydration mismatch assertions).\n * Automatically set to true during `vite dev` — override here to\n * force on or off.\n *\n * @default auto (true in dev, false in build)\n */\n dev?: boolean;\n };\n\n\n refresh: Omit<RefreshOptions & { disabled: boolean }, 'bundler' | 'fixRender' | 'jsx'>;\n}\n\nfunction getExtension(filename: string): string {\n const index = filename.lastIndexOf('.');\n return index < 0 ? '' : filename.substring(index).replace(/\\?.+$/, '');\n}\nfunction containsSolidField(fields: Record<string, any>) {\n const keys = Object.keys(fields);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (key === 'solid') return true;\n if (typeof fields[key] === 'object' && fields[key] != null && containsSolidField(fields[key]))\n return true;\n }\n return false;\n}\n\nfunction getJestDomExport(setupFiles: string[]) {\n return setupFiles?.some((path) => /jest-dom/.test(path))\n ? undefined\n : ['@testing-library/jest-dom/vitest', '@testing-library/jest-dom/extend-expect'].find(\n (path) => {\n try {\n require.resolve(path);\n return true;\n } catch (e) {\n return false;\n }\n },\n );\n}\n\nexport default function solidPlugin(options: Partial<Options> = {}): Plugin {\n const filter = createFilter(options.include, options.exclude);\n\n let needHmr = false;\n let replaceDev = false;\n let projectRoot = process.cwd();\n let isTestMode = false;\n let isBuild = false;\n let base = '/';\n let solidPkgsConfig: Awaited<ReturnType<typeof crawlFrameworkPkgs>>;\n\n return {\n name: 'solid',\n enforce: 'pre',\n\n async config(userConfig, { command }) {\n // We inject the dev mode only if the user explicitly wants it or if we are in dev (serve) mode\n replaceDev = options.dev === true || (options.dev !== false && command === 'serve');\n projectRoot = userConfig.root || projectRoot;\n isTestMode = userConfig.mode === 'test';\n\n if (!userConfig.resolve) userConfig.resolve = {};\n userConfig.resolve.alias = normalizeAliases(userConfig.resolve && userConfig.resolve.alias);\n\n solidPkgsConfig = await crawlFrameworkPkgs({\n viteUserConfig: userConfig,\n root: projectRoot || process.cwd(),\n isBuild: command === 'build',\n isFrameworkPkgByJson(pkgJson) {\n return containsSolidField(pkgJson.exports || {});\n },\n });\n\n // fix for bundling dev in production\n const nestedDeps = replaceDev\n ? ['solid-js', '@solidjs/web']\n : [];\n\n const userTest = (userConfig as any).test ?? {};\n const test = {} as any;\n if (userConfig.mode === 'test') {\n // to simplify the processing of the config, we normalize the setupFiles to an array\n const userSetupFiles: string[] =\n typeof userTest.setupFiles === 'string'\n ? [userTest.setupFiles]\n : userTest.setupFiles || [];\n\n if (!userTest.environment && !options.ssr) {\n test.environment = 'jsdom';\n }\n\n if (\n !userTest.server?.deps?.external?.find((item: string | RegExp) =>\n /solid-js/.test(item.toString()),\n )\n ) {\n test.server = { deps: { external: [/solid-js/] } };\n }\n if (!userTest.browser?.enabled) {\n // vitest browser mode already has bundled jest-dom assertions\n // https://main.vitest.dev/guide/browser/assertion-api.html#assertion-api\n const jestDomImport = getJestDomExport(userSetupFiles);\n if (jestDomImport) {\n test.setupFiles = [jestDomImport];\n }\n }\n }\n\n return {\n /**\n * We only need esbuild on .ts or .js files.\n * .tsx & .jsx files are handled by us\n */\n // esbuild: { include: /\\.ts$/ },\n resolve: {\n conditions: isVite6\n ? undefined\n : [\n 'solid',\n ...(replaceDev ? ['development'] : []),\n ...(userConfig.mode === 'test' && !options.ssr ? ['browser'] : []),\n ],\n dedupe: nestedDeps,\n alias: [{ find: /^solid-refresh$/, replacement: runtimePublicPath }],\n },\n optimizeDeps: {\n include: [...nestedDeps, ...solidPkgsConfig.optimizeDeps.include],\n exclude: solidPkgsConfig.optimizeDeps.exclude,\n },\n ...(!isVite6 ? { ssr: solidPkgsConfig.ssr } : {}),\n ...(test.server ? { test } : {}),\n };\n },\n\n // @ts-ignore This hook only works in Vite 6\n async configEnvironment(name, config, opts) {\n config.resolve ??= {};\n // Emulate Vite default fallback for `resolve.conditions` if not set\n if (config.resolve.conditions == null) {\n // @ts-ignore These exports only exist in Vite 6\n const { defaultClientConditions, defaultServerConditions } = await import('vite');\n if (config.consumer === 'client' || name === 'client' || opts.isSsrTargetWebworker) {\n config.resolve.conditions = [...defaultClientConditions];\n } else {\n config.resolve.conditions = [...defaultServerConditions];\n }\n }\n config.resolve.conditions = [\n 'solid',\n ...(replaceDev ? ['development'] : []),\n ...(isTestMode && !opts.isSsrTargetWebworker && !options.ssr ? ['browser'] : []),\n ...config.resolve.conditions,\n ];\n\n // Set resolve.noExternal and resolve.external for SSR environment (Vite 6+)\n // Only set resolve.external if noExternal is not true (to avoid conflicts with plugins like Cloudflare)\n if (isVite6 && name === 'ssr' && solidPkgsConfig) {\n if (config.resolve.noExternal !== true) {\n config.resolve.noExternal = [\n ...(Array.isArray(config.resolve.noExternal) ? config.resolve.noExternal : []),\n ...solidPkgsConfig.ssr.noExternal,\n ];\n config.resolve.external = [\n ...(Array.isArray(config.resolve.external) ? config.resolve.external : []),\n ...solidPkgsConfig.ssr.external,\n ];\n }\n }\n },\n\n configResolved(config) {\n isBuild = config.command === 'build';\n base = config.base;\n needHmr = config.command === 'serve' && config.mode !== 'production' && (options.hot !== false && !options.refresh?.disabled);\n },\n\n configureServer(server) {\n if (!needHmr) return;\n // When a module has a syntax error, Vite sends the error overlay via\n // WebSocket but the failed import triggers invalidation in solid-refresh.\n // This propagates up to @refresh reload boundaries (e.g. document-level\n // App components in SSR), causing a full-reload that overrides the overlay.\n // We suppress update/full-reload messages that immediately follow an error.\n const hot = server.hot ?? (server as any).ws;\n if (!hot) return;\n let lastErrorTime = 0;\n const origSend = hot.send.bind(hot);\n hot.send = function (this: any, ...args: any[]) {\n const payload = args[0];\n if (typeof payload === 'object' && payload) {\n if (payload.type === 'error') {\n lastErrorTime = Date.now();\n } else if (lastErrorTime && (payload.type === 'full-reload' || payload.type === 'update')) {\n if (Date.now() - lastErrorTime < 200) return;\n lastErrorTime = 0;\n }\n }\n return origSend(...args);\n } as typeof hot.send;\n },\n\n hotUpdate() {\n // solid-refresh only injects HMR boundaries into client modules, so\n // non-client environments have no accept handlers. Without this, Vite\n // would see no boundaries and send full-reload messages that race with\n // client-side HMR updates.\n if (this.environment.name !== 'client') {\n return [];\n }\n },\n\n resolveId(id) {\n if (id === runtimePublicPath) return id;\n if (id === VIRTUAL_MANIFEST_ID) return RESOLVED_VIRTUAL_MANIFEST_ID;\n },\n\n load(id) {\n if (id === runtimePublicPath) return runtimeCode;\n if (id === RESOLVED_VIRTUAL_MANIFEST_ID) {\n if (!isBuild) return DEV_MANIFEST_CODE;\n const manifestPath = path.resolve(projectRoot, 'dist/client/.vite/manifest.json');\n if (existsSync(manifestPath)) {\n const manifest = JSON.parse(readFileSync(manifestPath, 'utf-8'));\n manifest._base = base;\n return `export default ${JSON.stringify(manifest)};`;\n }\n return DEV_MANIFEST_CODE;\n }\n },\n\n async transform(source, id, transformOptions) {\n const isSsr = transformOptions && transformOptions.ssr;\n const currentFileExtension = getExtension(id);\n\n const extensionsToWatch = options.extensions || [];\n const allExtensions = extensionsToWatch.map((extension) =>\n // An extension can be a string or a tuple [extension, options]\n typeof extension === 'string' ? extension : extension[0],\n );\n\n if (!filter(id)) {\n return null;\n }\n\n id = id.replace(/\\?.*$/, '');\n\n if (!(/\\.[mc]?[tj]sx$/i.test(id) || allExtensions.includes(currentFileExtension))) {\n return null;\n }\n\n const inNodeModules = /node_modules/.test(id);\n\n let solidOptions: { generate: 'ssr' | 'dom'; hydratable: boolean };\n\n if (options.ssr) {\n if (isSsr) {\n solidOptions = { generate: 'ssr', hydratable: true };\n } else {\n solidOptions = { generate: 'dom', hydratable: true };\n }\n } else {\n solidOptions = { generate: 'dom', hydratable: false };\n }\n\n // We need to know if the current file extension has a typescript options tied to it\n const shouldBeProcessedWithTypescript =\n /\\.[mc]?tsx$/i.test(id) ||\n extensionsToWatch.some((extension) => {\n if (typeof extension === 'string') {\n return extension.includes('tsx');\n }\n\n const [extensionName, extensionOptions] = extension;\n if (extensionName !== currentFileExtension) return false;\n\n return extensionOptions.typescript;\n });\n const plugins: NonNullable<NonNullable<babel.TransformOptions['parserOpts']>['plugins']> = [\n 'jsx',\n 'decorators',\n ];\n\n if (shouldBeProcessedWithTypescript) {\n plugins.push('typescript');\n }\n\n const opts: babel.TransformOptions = {\n root: projectRoot,\n filename: id,\n sourceFileName: id,\n presets: [[solid, { ...solidOptions, dev: replaceDev, ...(options.solid || {}) }]],\n plugins: [\n [lazyModuleUrl],\n ...(needHmr && !isSsr && !inNodeModules ? [[solidRefresh, {\n ...(options.refresh || {}),\n bundler: 'vite',\n fixRender: true,\n // TODO unfortunately, even with SSR enabled for refresh\n // it still doesn't work, so now we have to disable\n // this config\n jsx: false,\n }]] : []),\n ],\n ast: false,\n sourceMaps: true,\n configFile: false,\n babelrc: false,\n parserOpts: {\n plugins,\n },\n };\n\n // Default value for babel user options\n let babelUserOptions: babel.TransformOptions = {};\n\n if (options.babel) {\n if (typeof options.babel === 'function') {\n const babelOptions = options.babel(source, id, !!isSsr);\n babelUserOptions = babelOptions instanceof Promise ? await babelOptions : babelOptions;\n } else {\n babelUserOptions = options.babel;\n }\n }\n\n const babelOptions = mergeAndConcat(babelUserOptions, opts) as babel.TransformOptions;\n\n const result = await babel.transformAsync(source, babelOptions);\n if (!result) {\n return undefined;\n }\n\n let code = result.code || '';\n\n // Resolve lazy() moduleUrl placeholders using Vite's resolver\n const placeholderRe = new RegExp(\n '\"' + LAZY_PLACEHOLDER_PREFIX + '([^\"]+)\"',\n 'g',\n );\n let match;\n const resolutions: Array<{ placeholder: string; resolved: string }> = [];\n while ((match = placeholderRe.exec(code)) !== null) {\n const specifier = match[1];\n const resolved = await this.resolve(specifier, id);\n if (resolved) {\n const cleanId = resolved.id.split('?')[0];\n resolutions.push({\n placeholder: match[0],\n resolved: '\"' + path.relative(projectRoot, cleanId) + '\"',\n });\n }\n }\n for (const { placeholder, resolved } of resolutions) {\n code = code.replace(placeholder, resolved);\n }\n\n return { code, map: result.map };\n },\n };\n}\n\n/**\n * This basically normalize all aliases of the config into\n * the array format of the alias.\n *\n * eg: alias: { '@': 'src/' } => [{ find: '@', replacement: 'src/' }]\n */\nfunction normalizeAliases(alias: AliasOptions = []): Alias[] {\n return Array.isArray(alias)\n ? alias\n : Object.entries(alias).map(([find, replacement]) => ({ find, replacement }));\n}\n\nexport type ViteManifest = Record<\n string,\n {\n file: string;\n css?: string[];\n isEntry?: boolean;\n isDynamicEntry?: boolean;\n imports?: string[];\n }\n> & {\n _base?: string;\n};\n"],"names":["LAZY_PLACEHOLDER_PREFIX","extractDynamicImportSpecifier","node","type","callExpr","body","length","argument","callee","arguments","arg","value","lazyModuleUrlPlugin","name","visitor","CallExpression","nodePath","state","filename","binding","scope","getBinding","kind","bindingPath","path","parent","source","specifier","push","require","createRequire","import","runtimePublicPath","runtimeFilePath","resolve","runtimeCode","readFileSync","isVite6","version","split","VIRTUAL_MANIFEST_ID","RESOLVED_VIRTUAL_MANIFEST_ID","DEV_MANIFEST_CODE","getExtension","index","lastIndexOf","substring","replace","containsSolidField","fields","keys","Object","i","key","getJestDomExport","setupFiles","some","test","undefined","find","e","solidPlugin","options","filter","createFilter","include","exclude","needHmr","replaceDev","projectRoot","process","cwd","isTestMode","isBuild","base","solidPkgsConfig","enforce","config","userConfig","command","dev","root","mode","alias","normalizeAliases","crawlFrameworkPkgs","viteUserConfig","isFrameworkPkgByJson","pkgJson","exports","nestedDeps","userTest","userSetupFiles","environment","ssr","server","deps","external","item","toString","browser","enabled","jestDomImport","conditions","dedupe","replacement","optimizeDeps","configEnvironment","opts","defaultClientConditions","defaultServerConditions","consumer","isSsrTargetWebworker","noExternal","Array","isArray","configResolved","hot","refresh","disabled","configureServer","ws","lastErrorTime","origSend","send","bind","args","payload","Date","now","hotUpdate","resolveId","id","load","manifestPath","existsSync","manifest","JSON","parse","_base","stringify","transform","transformOptions","isSsr","currentFileExtension","extensionsToWatch","extensions","allExtensions","map","extension","includes","inNodeModules","solidOptions","generate","hydratable","shouldBeProcessedWithTypescript","extensionName","extensionOptions","typescript","plugins","sourceFileName","presets","solid","lazyModuleUrl","solidRefresh","bundler","fixRender","jsx","ast","sourceMaps","configFile","babelrc","parserOpts","babelUserOptions","babel","babelOptions","Promise","mergeAndConcat","result","transformAsync","code","placeholderRe","RegExp","match","resolutions","exec","resolved","cleanId","placeholder","relative","entries"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAMA,uBAAuB,GAAG,wBAAwB;;AAE/D;AACA;AACA;AACA;AACA,SAASC,6BAA6BA,CAACC,IAAY,EAAiB;AA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,CAAC,CAAC,CAAC;YACrBG,QAAQ,EAAE,GAAG,GAAGlK,IAAI,CAACqK,QAAQ,CAACxH,WAAW,EAAEsH,OAAO,CAAC,GAAG;AACxD,WAAC,CAAC;AACJ;AACF;AACA,MAAA,KAAK,MAAM;QAAEC,WAAW;AAAEF,QAAAA;OAAU,IAAIF,WAAW,EAAE;QACnDJ,IAAI,GAAGA,IAAI,CAACrI,OAAO,CAAC6I,WAAW,EAAEF,QAAQ,CAAC;AAC5C;MAEA,OAAO;QAAEN,IAAI;QAAEhC,GAAG,EAAE8B,MAAM,CAAC9B;OAAK;AAClC;GACD;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAShE,gBAAgBA,CAACD,KAAmB,GAAG,EAAE,EAAW;EAC3D,OAAO+B,KAAK,CAACC,OAAO,CAAChC,KAAK,CAAC,GACvBA,KAAK,GACLhC,MAAM,CAAC2I,OAAO,CAAC3G,KAAK,CAAC,CAACiE,GAAG,CAAC,CAAC,CAACzF,IAAI,EAAE8C,WAAW,CAAC,MAAM;IAAE9C,IAAI;AAAE8C,IAAAA;AAAY,GAAC,CAAC,CAAC;AACjF;;;;"}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as babel from '@babel/core';
|
|
2
2
|
import solid from 'babel-preset-solid';
|
|
3
|
-
import { readFileSync } from 'fs';
|
|
3
|
+
import { readFileSync, existsSync } from 'fs';
|
|
4
4
|
import { mergeAndConcat } from 'merge-anything';
|
|
5
5
|
import { createRequire } from 'module';
|
|
6
6
|
import solidRefresh from 'solid-refresh/babel';
|
|
@@ -69,6 +69,14 @@ const runtimePublicPath = '/@solid-refresh';
|
|
|
69
69
|
const runtimeFilePath = require.resolve('solid-refresh/dist/solid-refresh.mjs');
|
|
70
70
|
const runtimeCode = readFileSync(runtimeFilePath, 'utf-8');
|
|
71
71
|
const isVite6 = +version.split('.')[0] >= 6;
|
|
72
|
+
const VIRTUAL_MANIFEST_ID = 'virtual:solid-manifest';
|
|
73
|
+
const RESOLVED_VIRTUAL_MANIFEST_ID = '\0' + VIRTUAL_MANIFEST_ID;
|
|
74
|
+
const DEV_MANIFEST_CODE = `export default new Proxy({}, {
|
|
75
|
+
get(_, key) {
|
|
76
|
+
if (typeof key !== "string") return undefined;
|
|
77
|
+
return { file: "/" + key };
|
|
78
|
+
}
|
|
79
|
+
});`;
|
|
72
80
|
|
|
73
81
|
/** Possible options for the extensions property */
|
|
74
82
|
|
|
@@ -103,6 +111,8 @@ function solidPlugin(options = {}) {
|
|
|
103
111
|
let replaceDev = false;
|
|
104
112
|
let projectRoot = process.cwd();
|
|
105
113
|
let isTestMode = false;
|
|
114
|
+
let isBuild = false;
|
|
115
|
+
let base = '/';
|
|
106
116
|
let solidPkgsConfig;
|
|
107
117
|
return {
|
|
108
118
|
name: 'solid',
|
|
@@ -205,13 +215,59 @@ function solidPlugin(options = {}) {
|
|
|
205
215
|
}
|
|
206
216
|
},
|
|
207
217
|
configResolved(config) {
|
|
218
|
+
isBuild = config.command === 'build';
|
|
219
|
+
base = config.base;
|
|
208
220
|
needHmr = config.command === 'serve' && config.mode !== 'production' && options.hot !== false && !options.refresh?.disabled;
|
|
209
221
|
},
|
|
222
|
+
configureServer(server) {
|
|
223
|
+
if (!needHmr) return;
|
|
224
|
+
// When a module has a syntax error, Vite sends the error overlay via
|
|
225
|
+
// WebSocket but the failed import triggers invalidation in solid-refresh.
|
|
226
|
+
// This propagates up to @refresh reload boundaries (e.g. document-level
|
|
227
|
+
// App components in SSR), causing a full-reload that overrides the overlay.
|
|
228
|
+
// We suppress update/full-reload messages that immediately follow an error.
|
|
229
|
+
const hot = server.hot ?? server.ws;
|
|
230
|
+
if (!hot) return;
|
|
231
|
+
let lastErrorTime = 0;
|
|
232
|
+
const origSend = hot.send.bind(hot);
|
|
233
|
+
hot.send = function (...args) {
|
|
234
|
+
const payload = args[0];
|
|
235
|
+
if (typeof payload === 'object' && payload) {
|
|
236
|
+
if (payload.type === 'error') {
|
|
237
|
+
lastErrorTime = Date.now();
|
|
238
|
+
} else if (lastErrorTime && (payload.type === 'full-reload' || payload.type === 'update')) {
|
|
239
|
+
if (Date.now() - lastErrorTime < 200) return;
|
|
240
|
+
lastErrorTime = 0;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return origSend(...args);
|
|
244
|
+
};
|
|
245
|
+
},
|
|
246
|
+
hotUpdate() {
|
|
247
|
+
// solid-refresh only injects HMR boundaries into client modules, so
|
|
248
|
+
// non-client environments have no accept handlers. Without this, Vite
|
|
249
|
+
// would see no boundaries and send full-reload messages that race with
|
|
250
|
+
// client-side HMR updates.
|
|
251
|
+
if (this.environment.name !== 'client') {
|
|
252
|
+
return [];
|
|
253
|
+
}
|
|
254
|
+
},
|
|
210
255
|
resolveId(id) {
|
|
211
256
|
if (id === runtimePublicPath) return id;
|
|
257
|
+
if (id === VIRTUAL_MANIFEST_ID) return RESOLVED_VIRTUAL_MANIFEST_ID;
|
|
212
258
|
},
|
|
213
259
|
load(id) {
|
|
214
260
|
if (id === runtimePublicPath) return runtimeCode;
|
|
261
|
+
if (id === RESOLVED_VIRTUAL_MANIFEST_ID) {
|
|
262
|
+
if (!isBuild) return DEV_MANIFEST_CODE;
|
|
263
|
+
const manifestPath = path.resolve(projectRoot, 'dist/client/.vite/manifest.json');
|
|
264
|
+
if (existsSync(manifestPath)) {
|
|
265
|
+
const manifest = JSON.parse(readFileSync(manifestPath, 'utf-8'));
|
|
266
|
+
manifest._base = base;
|
|
267
|
+
return `export default ${JSON.stringify(manifest)};`;
|
|
268
|
+
}
|
|
269
|
+
return DEV_MANIFEST_CODE;
|
|
270
|
+
}
|
|
215
271
|
},
|
|
216
272
|
async transform(source, id, transformOptions) {
|
|
217
273
|
const isSsr = transformOptions && transformOptions.ssr;
|
|
@@ -346,34 +402,6 @@ function normalizeAliases(alias = []) {
|
|
|
346
402
|
replacement
|
|
347
403
|
}));
|
|
348
404
|
}
|
|
349
|
-
let _manifest;
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Returns the Vite asset manifest for SSR.
|
|
353
|
-
* In production, reads and caches the manifest JSON from `manifestPath`.
|
|
354
|
-
* In development (file not found), returns a proxy that maps each moduleUrl
|
|
355
|
-
* to its dev server path, so lazy() asset resolution works without a build.
|
|
356
|
-
*/
|
|
357
|
-
function getManifest(manifestPath) {
|
|
358
|
-
if (_manifest) return _manifest;
|
|
359
|
-
if (manifestPath) {
|
|
360
|
-
try {
|
|
361
|
-
_manifest = JSON.parse(readFileSync(manifestPath, 'utf-8'));
|
|
362
|
-
return _manifest;
|
|
363
|
-
} catch {
|
|
364
|
-
// File doesn't exist — dev mode, fall through
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
_manifest = new Proxy({}, {
|
|
368
|
-
get(_, key) {
|
|
369
|
-
if (typeof key !== 'string') return undefined;
|
|
370
|
-
return {
|
|
371
|
-
file: '/' + key
|
|
372
|
-
};
|
|
373
|
-
}
|
|
374
|
-
});
|
|
375
|
-
return _manifest;
|
|
376
|
-
}
|
|
377
405
|
|
|
378
|
-
export { solidPlugin as default
|
|
406
|
+
export { solidPlugin as default };
|
|
379
407
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/lazy-module-url.ts","../../src/index.ts"],"sourcesContent":["import type { PluginObj, types as t } from '@babel/core';\n\nexport const LAZY_PLACEHOLDER_PREFIX = '__SOLID_LAZY_MODULE__:';\n\n/**\n * Detects whether a CallExpression argument is `() => import(\"specifier\")`\n * and returns the specifier string if so.\n */\nfunction extractDynamicImportSpecifier(node: t.Node): string | null {\n if (node.type !== 'ArrowFunctionExpression' && node.type !== 'FunctionExpression') return null;\n\n let callExpr: t.CallExpression | null = null;\n if (node.body.type === 'CallExpression') {\n callExpr = node.body;\n } else if (\n node.body.type === 'BlockStatement' &&\n node.body.body.length === 1 &&\n node.body.body[0].type === 'ReturnStatement' &&\n node.body.body[0].argument?.type === 'CallExpression'\n ) {\n callExpr = node.body.body[0].argument;\n }\n if (!callExpr) return null;\n\n if (callExpr.callee.type !== 'Import') return null;\n if (callExpr.arguments.length !== 1) return null;\n\n const arg = callExpr.arguments[0];\n if (arg.type !== 'StringLiteral') return null;\n\n return arg.value;\n}\n\n/**\n * Babel plugin that detects `lazy(() => import(\"specifier\"))` calls\n * and injects a placeholder as the second argument. The placeholder\n * is resolved to a real path by the Vite transform hook using this.resolve().\n */\nexport default function lazyModuleUrlPlugin(): PluginObj {\n return {\n name: 'solid-lazy-module-url',\n visitor: {\n CallExpression(nodePath, state) {\n if (!state.filename) return;\n const { node } = nodePath;\n\n if (node.callee.type !== 'Identifier' || node.callee.name !== 'lazy') return;\n\n const binding = nodePath.scope.getBinding('lazy');\n if (!binding || binding.kind !== 'module') return;\n const bindingPath = binding.path;\n if (\n bindingPath.type !== 'ImportSpecifier' ||\n bindingPath.parent.type !== 'ImportDeclaration'\n )\n return;\n const source = (bindingPath.parent as t.ImportDeclaration).source.value;\n if (source !== 'solid-js') return;\n\n if (node.arguments.length >= 2) return;\n if (node.arguments.length !== 1) return;\n\n const specifier = extractDynamicImportSpecifier(node.arguments[0] as t.Node);\n if (!specifier) return;\n\n node.arguments.push({\n type: 'StringLiteral',\n value: LAZY_PLACEHOLDER_PREFIX + specifier,\n } as t.StringLiteral);\n },\n },\n };\n}\n","import * as babel from '@babel/core';\nimport solid from 'babel-preset-solid';\nimport { readFileSync } from 'fs';\nimport { mergeAndConcat } from 'merge-anything';\nimport { createRequire } from 'module';\nimport solidRefresh from 'solid-refresh/babel';\n// TODO use proper path\nimport type { Options as RefreshOptions } from 'solid-refresh/babel';\nimport lazyModuleUrl, { LAZY_PLACEHOLDER_PREFIX } from './lazy-module-url.js';\nimport path from 'path';\nimport type { Alias, AliasOptions, FilterPattern, Plugin } from 'vite';\nimport { createFilter, version } from 'vite';\nimport { crawlFrameworkPkgs } from 'vitefu';\n\nconst require = createRequire(import.meta.url);\n\nconst runtimePublicPath = '/@solid-refresh';\nconst runtimeFilePath = require.resolve('solid-refresh/dist/solid-refresh.mjs');\nconst runtimeCode = readFileSync(runtimeFilePath, 'utf-8');\n\nconst isVite6 = +version.split('.')[0] >= 6;\n\n/** Possible options for the extensions property */\nexport interface ExtensionOptions {\n typescript?: boolean;\n}\n\n/** Configuration options for vite-plugin-solid. */\nexport interface Options {\n /**\n * A [picomatch](https://github.com/micromatch/picomatch) pattern, or array of patterns, which specifies the files\n * the plugin should operate on.\n */\n include?: FilterPattern;\n /**\n * A [picomatch](https://github.com/micromatch/picomatch) pattern, or array of patterns, which specifies the files\n * to be ignored by the plugin.\n */\n exclude?: FilterPattern;\n /**\n * This will inject solid-js/dev in place of solid-js in dev mode. Has no\n * effect in prod. If set to `false`, it won't inject it in dev. This is\n * useful for extra logs and debugging.\n *\n * @default true\n */\n dev?: boolean;\n /**\n * This will force SSR code in the produced files.\n *\n * @default false\n */\n ssr?: boolean;\n\n /**\n * This will inject HMR runtime in dev mode. Has no effect in prod. If\n * set to `false`, it won't inject the runtime in dev.\n *\n * @default true\n * @deprecated use `refresh` instead\n */\n hot?: boolean;\n /**\n * This registers additional extensions that should be processed by\n * vite-plugin-solid.\n *\n * @default undefined\n */\n extensions?: (string | [string, ExtensionOptions])[];\n /**\n * Pass any additional babel transform options. They will be merged with\n * the transformations required by Solid.\n *\n * @default {}\n */\n babel?:\n | babel.TransformOptions\n | ((source: string, id: string, ssr: boolean) => babel.TransformOptions)\n | ((source: string, id: string, ssr: boolean) => Promise<babel.TransformOptions>);\n /**\n * Pass any additional [babel-plugin-jsx-dom-expressions](https://github.com/ryansolid/dom-expressions/tree/main/packages/babel-plugin-jsx-dom-expressions#plugin-options).\n * They will be merged with the defaults sets by [babel-preset-solid](https://github.com/solidjs/solid/blob/main/packages/babel-preset-solid/index.js#L8-L25).\n *\n * @default {}\n */\n solid?: {\n /**\n * Remove unnecessary closing tags from template strings. More info here:\n * https://github.com/solidjs/solid/blob/main/CHANGELOG.md#smaller-templates\n *\n * @default false\n */\n omitNestedClosingTags?: boolean;\n\n /**\n * Remove the last closing tag from template strings. Enabled by default even when `omitNestedClosingTags` is disabled.\n * Can be disabled for compatibility for some browser-like environments.\n *\n * @default true\n */\n omitLastClosingTag?: boolean;\n\n /**\n * Remove unnecessary quotes from template strings.\n * Can be disabled for compatibility for some browser-like environments.\n *\n * @default true\n */\n omitQuotes?: boolean;\n\n /**\n * The name of the runtime module to import the methods from.\n *\n * @default \"solid-js/web\"\n */\n moduleName?: string;\n\n /**\n * The output mode of the compiler.\n * Can be:\n * - \"dom\" is standard output\n * - \"ssr\" is for server side rendering of strings.\n * - \"universal\" is for using custom renderers from solid-js/universal\n *\n * @default \"dom\"\n */\n generate?: 'ssr' | 'dom' | 'universal';\n\n /**\n * Indicate whether the output should contain hydratable markers.\n *\n * @default false\n */\n hydratable?: boolean;\n\n /**\n * Boolean to indicate whether to enable automatic event delegation on camelCase.\n *\n * @default true\n */\n delegateEvents?: boolean;\n\n /**\n * Boolean indicates whether smart conditional detection should be used.\n * This optimizes simple boolean expressions and ternaries in JSX.\n *\n * @default true\n */\n wrapConditionals?: boolean;\n\n /**\n * Boolean indicates whether to set current render context on Custom Elements and slots.\n * Useful for seemless Context API with Web Components.\n *\n * @default true\n */\n contextToCustomElements?: boolean;\n\n /**\n * Array of Component exports from module, that aren't included by default with the library.\n * This plugin will automatically import them if it comes across them in the JSX.\n *\n * @default [\"For\",\"Show\",\"Switch\",\"Match\",\"Suspense\",\"SuspenseList\",\"Portal\",\"Index\",\"Dynamic\",\"ErrorBoundary\"]\n */\n builtIns?: string[];\n\n /**\n * Enable dev-mode compilation output. When true, the compiler emits\n * additional runtime checks (e.g. hydration mismatch assertions).\n * Automatically set to true during `vite dev` — override here to\n * force on or off.\n *\n * @default auto (true in dev, false in build)\n */\n dev?: boolean;\n };\n\n\n refresh: Omit<RefreshOptions & { disabled: boolean }, 'bundler' | 'fixRender' | 'jsx'>;\n}\n\nfunction getExtension(filename: string): string {\n const index = filename.lastIndexOf('.');\n return index < 0 ? '' : filename.substring(index).replace(/\\?.+$/, '');\n}\nfunction containsSolidField(fields: Record<string, any>) {\n const keys = Object.keys(fields);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (key === 'solid') return true;\n if (typeof fields[key] === 'object' && fields[key] != null && containsSolidField(fields[key]))\n return true;\n }\n return false;\n}\n\nfunction getJestDomExport(setupFiles: string[]) {\n return setupFiles?.some((path) => /jest-dom/.test(path))\n ? undefined\n : ['@testing-library/jest-dom/vitest', '@testing-library/jest-dom/extend-expect'].find(\n (path) => {\n try {\n require.resolve(path);\n return true;\n } catch (e) {\n return false;\n }\n },\n );\n}\n\nexport default function solidPlugin(options: Partial<Options> = {}): Plugin {\n const filter = createFilter(options.include, options.exclude);\n\n let needHmr = false;\n let replaceDev = false;\n let projectRoot = process.cwd();\n let isTestMode = false;\n let solidPkgsConfig: Awaited<ReturnType<typeof crawlFrameworkPkgs>>;\n\n return {\n name: 'solid',\n enforce: 'pre',\n\n async config(userConfig, { command }) {\n // We inject the dev mode only if the user explicitly wants it or if we are in dev (serve) mode\n replaceDev = options.dev === true || (options.dev !== false && command === 'serve');\n projectRoot = userConfig.root || projectRoot;\n isTestMode = userConfig.mode === 'test';\n\n if (!userConfig.resolve) userConfig.resolve = {};\n userConfig.resolve.alias = normalizeAliases(userConfig.resolve && userConfig.resolve.alias);\n\n solidPkgsConfig = await crawlFrameworkPkgs({\n viteUserConfig: userConfig,\n root: projectRoot || process.cwd(),\n isBuild: command === 'build',\n isFrameworkPkgByJson(pkgJson) {\n return containsSolidField(pkgJson.exports || {});\n },\n });\n\n // fix for bundling dev in production\n const nestedDeps = replaceDev\n ? ['solid-js', '@solidjs/web']\n : [];\n\n const userTest = (userConfig as any).test ?? {};\n const test = {} as any;\n if (userConfig.mode === 'test') {\n // to simplify the processing of the config, we normalize the setupFiles to an array\n const userSetupFiles: string[] =\n typeof userTest.setupFiles === 'string'\n ? [userTest.setupFiles]\n : userTest.setupFiles || [];\n\n if (!userTest.environment && !options.ssr) {\n test.environment = 'jsdom';\n }\n\n if (\n !userTest.server?.deps?.external?.find((item: string | RegExp) =>\n /solid-js/.test(item.toString()),\n )\n ) {\n test.server = { deps: { external: [/solid-js/] } };\n }\n if (!userTest.browser?.enabled) {\n // vitest browser mode already has bundled jest-dom assertions\n // https://main.vitest.dev/guide/browser/assertion-api.html#assertion-api\n const jestDomImport = getJestDomExport(userSetupFiles);\n if (jestDomImport) {\n test.setupFiles = [jestDomImport];\n }\n }\n }\n\n return {\n /**\n * We only need esbuild on .ts or .js files.\n * .tsx & .jsx files are handled by us\n */\n // esbuild: { include: /\\.ts$/ },\n resolve: {\n conditions: isVite6\n ? undefined\n : [\n 'solid',\n ...(replaceDev ? ['development'] : []),\n ...(userConfig.mode === 'test' && !options.ssr ? ['browser'] : []),\n ],\n dedupe: nestedDeps,\n alias: [{ find: /^solid-refresh$/, replacement: runtimePublicPath }],\n },\n optimizeDeps: {\n include: [...nestedDeps, ...solidPkgsConfig.optimizeDeps.include],\n exclude: solidPkgsConfig.optimizeDeps.exclude,\n },\n ...(!isVite6 ? { ssr: solidPkgsConfig.ssr } : {}),\n ...(test.server ? { test } : {}),\n };\n },\n\n // @ts-ignore This hook only works in Vite 6\n async configEnvironment(name, config, opts) {\n config.resolve ??= {};\n // Emulate Vite default fallback for `resolve.conditions` if not set\n if (config.resolve.conditions == null) {\n // @ts-ignore These exports only exist in Vite 6\n const { defaultClientConditions, defaultServerConditions } = await import('vite');\n if (config.consumer === 'client' || name === 'client' || opts.isSsrTargetWebworker) {\n config.resolve.conditions = [...defaultClientConditions];\n } else {\n config.resolve.conditions = [...defaultServerConditions];\n }\n }\n config.resolve.conditions = [\n 'solid',\n ...(replaceDev ? ['development'] : []),\n ...(isTestMode && !opts.isSsrTargetWebworker && !options.ssr ? ['browser'] : []),\n ...config.resolve.conditions,\n ];\n\n // Set resolve.noExternal and resolve.external for SSR environment (Vite 6+)\n // Only set resolve.external if noExternal is not true (to avoid conflicts with plugins like Cloudflare)\n if (isVite6 && name === 'ssr' && solidPkgsConfig) {\n if (config.resolve.noExternal !== true) {\n config.resolve.noExternal = [\n ...(Array.isArray(config.resolve.noExternal) ? config.resolve.noExternal : []),\n ...solidPkgsConfig.ssr.noExternal,\n ];\n config.resolve.external = [\n ...(Array.isArray(config.resolve.external) ? config.resolve.external : []),\n ...solidPkgsConfig.ssr.external,\n ];\n }\n }\n },\n\n configResolved(config) {\n needHmr = config.command === 'serve' && config.mode !== 'production' && (options.hot !== false && !options.refresh?.disabled);\n },\n\n resolveId(id) {\n if (id === runtimePublicPath) return id;\n },\n\n load(id) {\n if (id === runtimePublicPath) return runtimeCode;\n },\n\n async transform(source, id, transformOptions) {\n const isSsr = transformOptions && transformOptions.ssr;\n const currentFileExtension = getExtension(id);\n\n const extensionsToWatch = options.extensions || [];\n const allExtensions = extensionsToWatch.map((extension) =>\n // An extension can be a string or a tuple [extension, options]\n typeof extension === 'string' ? extension : extension[0],\n );\n\n if (!filter(id)) {\n return null;\n }\n\n id = id.replace(/\\?.*$/, '');\n\n if (!(/\\.[mc]?[tj]sx$/i.test(id) || allExtensions.includes(currentFileExtension))) {\n return null;\n }\n\n const inNodeModules = /node_modules/.test(id);\n\n let solidOptions: { generate: 'ssr' | 'dom'; hydratable: boolean };\n\n if (options.ssr) {\n if (isSsr) {\n solidOptions = { generate: 'ssr', hydratable: true };\n } else {\n solidOptions = { generate: 'dom', hydratable: true };\n }\n } else {\n solidOptions = { generate: 'dom', hydratable: false };\n }\n\n // We need to know if the current file extension has a typescript options tied to it\n const shouldBeProcessedWithTypescript =\n /\\.[mc]?tsx$/i.test(id) ||\n extensionsToWatch.some((extension) => {\n if (typeof extension === 'string') {\n return extension.includes('tsx');\n }\n\n const [extensionName, extensionOptions] = extension;\n if (extensionName !== currentFileExtension) return false;\n\n return extensionOptions.typescript;\n });\n const plugins: NonNullable<NonNullable<babel.TransformOptions['parserOpts']>['plugins']> = [\n 'jsx',\n 'decorators',\n ];\n\n if (shouldBeProcessedWithTypescript) {\n plugins.push('typescript');\n }\n\n const opts: babel.TransformOptions = {\n root: projectRoot,\n filename: id,\n sourceFileName: id,\n presets: [[solid, { ...solidOptions, dev: replaceDev, ...(options.solid || {}) }]],\n plugins: [\n [lazyModuleUrl],\n ...(needHmr && !isSsr && !inNodeModules ? [[solidRefresh, {\n ...(options.refresh || {}),\n bundler: 'vite',\n fixRender: true,\n // TODO unfortunately, even with SSR enabled for refresh\n // it still doesn't work, so now we have to disable\n // this config\n jsx: false,\n }]] : []),\n ],\n ast: false,\n sourceMaps: true,\n configFile: false,\n babelrc: false,\n parserOpts: {\n plugins,\n },\n };\n\n // Default value for babel user options\n let babelUserOptions: babel.TransformOptions = {};\n\n if (options.babel) {\n if (typeof options.babel === 'function') {\n const babelOptions = options.babel(source, id, !!isSsr);\n babelUserOptions = babelOptions instanceof Promise ? await babelOptions : babelOptions;\n } else {\n babelUserOptions = options.babel;\n }\n }\n\n const babelOptions = mergeAndConcat(babelUserOptions, opts) as babel.TransformOptions;\n\n const result = await babel.transformAsync(source, babelOptions);\n if (!result) {\n return undefined;\n }\n\n let code = result.code || '';\n\n // Resolve lazy() moduleUrl placeholders using Vite's resolver\n const placeholderRe = new RegExp(\n '\"' + LAZY_PLACEHOLDER_PREFIX + '([^\"]+)\"',\n 'g',\n );\n let match;\n const resolutions: Array<{ placeholder: string; resolved: string }> = [];\n while ((match = placeholderRe.exec(code)) !== null) {\n const specifier = match[1];\n const resolved = await this.resolve(specifier, id);\n if (resolved) {\n const cleanId = resolved.id.split('?')[0];\n resolutions.push({\n placeholder: match[0],\n resolved: '\"' + path.relative(projectRoot, cleanId) + '\"',\n });\n }\n }\n for (const { placeholder, resolved } of resolutions) {\n code = code.replace(placeholder, resolved);\n }\n\n return { code, map: result.map };\n },\n };\n}\n\n/**\n * This basically normalize all aliases of the config into\n * the array format of the alias.\n *\n * eg: alias: { '@': 'src/' } => [{ find: '@', replacement: 'src/' }]\n */\nfunction normalizeAliases(alias: AliasOptions = []): Alias[] {\n return Array.isArray(alias)\n ? alias\n : Object.entries(alias).map(([find, replacement]) => ({ find, replacement }));\n}\n\nexport type ViteManifest = Record<\n string,\n {\n file: string;\n css?: string[];\n isEntry?: boolean;\n isDynamicEntry?: boolean;\n imports?: string[];\n }\n>;\n\nlet _manifest: ViteManifest | undefined;\n\n/**\n * Returns the Vite asset manifest for SSR.\n * In production, reads and caches the manifest JSON from `manifestPath`.\n * In development (file not found), returns a proxy that maps each moduleUrl\n * to its dev server path, so lazy() asset resolution works without a build.\n */\nexport function getManifest(manifestPath?: string): ViteManifest {\n if (_manifest) return _manifest;\n if (manifestPath) {\n try {\n _manifest = JSON.parse(readFileSync(manifestPath, 'utf-8'));\n return _manifest!;\n } catch {\n // File doesn't exist — dev mode, fall through\n }\n }\n _manifest = new Proxy(\n {},\n {\n get(_, key) {\n if (typeof key !== 'string') return undefined;\n return { file: '/' + key };\n },\n },\n ) as ViteManifest;\n return _manifest;\n}\n"],"names":["LAZY_PLACEHOLDER_PREFIX","extractDynamicImportSpecifier","node","type","callExpr","body","length","argument","callee","arguments","arg","value","lazyModuleUrlPlugin","name","visitor","CallExpression","nodePath","state","filename","binding","scope","getBinding","kind","bindingPath","path","parent","source","specifier","push","require","createRequire","import","meta","url","runtimePublicPath","runtimeFilePath","resolve","runtimeCode","readFileSync","isVite6","version","split","getExtension","index","lastIndexOf","substring","replace","containsSolidField","fields","keys","Object","i","key","getJestDomExport","setupFiles","some","test","undefined","find","e","solidPlugin","options","filter","createFilter","include","exclude","needHmr","replaceDev","projectRoot","process","cwd","isTestMode","solidPkgsConfig","enforce","config","userConfig","command","dev","root","mode","alias","normalizeAliases","crawlFrameworkPkgs","viteUserConfig","isBuild","isFrameworkPkgByJson","pkgJson","exports","nestedDeps","userTest","userSetupFiles","environment","ssr","server","deps","external","item","toString","browser","enabled","jestDomImport","conditions","dedupe","replacement","optimizeDeps","configEnvironment","opts","defaultClientConditions","defaultServerConditions","consumer","isSsrTargetWebworker","noExternal","Array","isArray","configResolved","hot","refresh","disabled","resolveId","id","load","transform","transformOptions","isSsr","currentFileExtension","extensionsToWatch","extensions","allExtensions","map","extension","includes","inNodeModules","solidOptions","generate","hydratable","shouldBeProcessedWithTypescript","extensionName","extensionOptions","typescript","plugins","sourceFileName","presets","solid","lazyModuleUrl","solidRefresh","bundler","fixRender","jsx","ast","sourceMaps","configFile","babelrc","parserOpts","babelUserOptions","babel","babelOptions","Promise","mergeAndConcat","result","transformAsync","code","placeholderRe","RegExp","match","resolutions","exec","resolved","cleanId","placeholder","relative","entries","_manifest","getManifest","manifestPath","JSON","parse","Proxy","get","_","file"],"mappings":";;;;;;;;;;AAEO,MAAMA,uBAAuB,GAAG,wBAAwB;;AAE/D;AACA;AACA;AACA;AACA,SAASC,6BAA6BA,CAACC,IAAY,EAAiB;AAClE,EAAA,IAAIA,IAAI,CAACC,IAAI,KAAK,yBAAyB,IAAID,IAAI,CAACC,IAAI,KAAK,oBAAoB,EAAE,OAAO,IAAI;EAE9F,IAAIC,QAAiC,GAAG,IAAI;AAC5C,EAAA,IAAIF,IAAI,CAACG,IAAI,CAACF,IAAI,KAAK,gBAAgB,EAAE;IACvCC,QAAQ,GAAGF,IAAI,CAACG,IAAI;GACrB,MAAM,IACLH,IAAI,CAACG,IAAI,CAACF,IAAI,KAAK,gBAAgB,IACnCD,IAAI,CAACG,IAAI,CAACA,IAAI,CAACC,MAAM,KAAK,CAAC,IAC3BJ,IAAI,CAACG,IAAI,CAACA,IAAI,CAAC,CAAC,CAAC,CAACF,IAAI,KAAK,iBAAiB,IAC5CD,IAAI,CAACG,IAAI,CAACA,IAAI,CAAC,CAAC,CAAC,CAACE,QAAQ,EAAEJ,IAAI,KAAK,gBAAgB,EACrD;IACAC,QAAQ,GAAGF,IAAI,CAACG,IAAI,CAACA,IAAI,CAAC,CAAC,CAAC,CAACE,QAAQ;AACvC;AACA,EAAA,IAAI,CAACH,QA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module-url.ts","../../src/index.ts"],"sourcesContent":["import type { PluginObj, types as t } from '@babel/core';\n\nexport const LAZY_PLACEHOLDER_PREFIX = '__SOLID_LAZY_MODULE__:';\n\n/**\n * Detects whether a CallExpression argument is `() => import(\"specifier\")`\n * and returns the specifier string if so.\n */\nfunction extractDynamicImportSpecifier(node: t.Node): string | null {\n if (node.type !== 'ArrowFunctionExpression' && node.type !== 'FunctionExpression') return null;\n\n let callExpr: t.CallExpression | null = null;\n if (node.body.type === 'CallExpression') {\n callExpr = node.body;\n } else if (\n node.body.type === 'BlockStatement' &&\n node.body.body.length === 1 &&\n node.body.body[0].type === 'ReturnStatement' &&\n node.body.body[0].argument?.type === 'CallExpression'\n ) {\n callExpr = node.body.body[0].argument;\n }\n if (!callExpr) return null;\n\n if (callExpr.callee.type !== 'Import') return null;\n if (callExpr.arguments.length !== 1) return null;\n\n const arg = callExpr.arguments[0];\n if (arg.type !== 'StringLiteral') return null;\n\n return arg.value;\n}\n\n/**\n * Babel plugin that detects `lazy(() => import(\"specifier\"))` calls\n * and injects a placeholder as the second argument. The placeholder\n * is resolved to a real path by the Vite transform hook using this.resolve().\n */\nexport default function lazyModuleUrlPlugin(): PluginObj {\n return {\n name: 'solid-lazy-module-url',\n visitor: {\n CallExpression(nodePath, state) {\n if (!state.filename) return;\n const { node } = nodePath;\n\n if (node.callee.type !== 'Identifier' || node.callee.name !== 'lazy') return;\n\n const binding = nodePath.scope.getBinding('lazy');\n if (!binding || binding.kind !== 'module') return;\n const bindingPath = binding.path;\n if (\n bindingPath.type !== 'ImportSpecifier' ||\n bindingPath.parent.type !== 'ImportDeclaration'\n )\n return;\n const source = (bindingPath.parent as t.ImportDeclaration).source.value;\n if (source !== 'solid-js') return;\n\n if (node.arguments.length >= 2) return;\n if (node.arguments.length !== 1) return;\n\n const specifier = extractDynamicImportSpecifier(node.arguments[0] as t.Node);\n if (!specifier) return;\n\n node.arguments.push({\n type: 'StringLiteral',\n value: LAZY_PLACEHOLDER_PREFIX + specifier,\n } as t.StringLiteral);\n },\n },\n };\n}\n","import * as babel from '@babel/core';\nimport solid from 'babel-preset-solid';\nimport { existsSync, readFileSync } from 'fs';\nimport { mergeAndConcat } from 'merge-anything';\nimport { createRequire } from 'module';\nimport solidRefresh from 'solid-refresh/babel';\n// TODO use proper path\nimport type { Options as RefreshOptions } from 'solid-refresh/babel';\nimport lazyModuleUrl, { LAZY_PLACEHOLDER_PREFIX } from './lazy-module-url.js';\nimport path from 'path';\nimport type { Alias, AliasOptions, FilterPattern, Plugin } from 'vite';\nimport { createFilter, version } from 'vite';\nimport { crawlFrameworkPkgs } from 'vitefu';\n\nconst require = createRequire(import.meta.url);\n\nconst runtimePublicPath = '/@solid-refresh';\nconst runtimeFilePath = require.resolve('solid-refresh/dist/solid-refresh.mjs');\nconst runtimeCode = readFileSync(runtimeFilePath, 'utf-8');\n\nconst isVite6 = +version.split('.')[0] >= 6;\n\nconst VIRTUAL_MANIFEST_ID = 'virtual:solid-manifest';\nconst RESOLVED_VIRTUAL_MANIFEST_ID = '\\0' + VIRTUAL_MANIFEST_ID;\n\nconst DEV_MANIFEST_CODE = `export default new Proxy({}, {\n get(_, key) {\n if (typeof key !== \"string\") return undefined;\n return { file: \"/\" + key };\n }\n});`;\n\n/** Possible options for the extensions property */\nexport interface ExtensionOptions {\n typescript?: boolean;\n}\n\n/** Configuration options for vite-plugin-solid. */\nexport interface Options {\n /**\n * A [picomatch](https://github.com/micromatch/picomatch) pattern, or array of patterns, which specifies the files\n * the plugin should operate on.\n */\n include?: FilterPattern;\n /**\n * A [picomatch](https://github.com/micromatch/picomatch) pattern, or array of patterns, which specifies the files\n * to be ignored by the plugin.\n */\n exclude?: FilterPattern;\n /**\n * This will inject solid-js/dev in place of solid-js in dev mode. Has no\n * effect in prod. If set to `false`, it won't inject it in dev. This is\n * useful for extra logs and debugging.\n *\n * @default true\n */\n dev?: boolean;\n /**\n * This will force SSR code in the produced files.\n *\n * @default false\n */\n ssr?: boolean;\n\n /**\n * This will inject HMR runtime in dev mode. Has no effect in prod. If\n * set to `false`, it won't inject the runtime in dev.\n *\n * @default true\n * @deprecated use `refresh` instead\n */\n hot?: boolean;\n /**\n * This registers additional extensions that should be processed by\n * vite-plugin-solid.\n *\n * @default undefined\n */\n extensions?: (string | [string, ExtensionOptions])[];\n /**\n * Pass any additional babel transform options. They will be merged with\n * the transformations required by Solid.\n *\n * @default {}\n */\n babel?:\n | babel.TransformOptions\n | ((source: string, id: string, ssr: boolean) => babel.TransformOptions)\n | ((source: string, id: string, ssr: boolean) => Promise<babel.TransformOptions>);\n /**\n * Pass any additional [babel-plugin-jsx-dom-expressions](https://github.com/ryansolid/dom-expressions/tree/main/packages/babel-plugin-jsx-dom-expressions#plugin-options).\n * They will be merged with the defaults sets by [babel-preset-solid](https://github.com/solidjs/solid/blob/main/packages/babel-preset-solid/index.js#L8-L25).\n *\n * @default {}\n */\n solid?: {\n /**\n * Remove unnecessary closing tags from template strings. More info here:\n * https://github.com/solidjs/solid/blob/main/CHANGELOG.md#smaller-templates\n *\n * @default false\n */\n omitNestedClosingTags?: boolean;\n\n /**\n * Remove the last closing tag from template strings. Enabled by default even when `omitNestedClosingTags` is disabled.\n * Can be disabled for compatibility for some browser-like environments.\n *\n * @default true\n */\n omitLastClosingTag?: boolean;\n\n /**\n * Remove unnecessary quotes from template strings.\n * Can be disabled for compatibility for some browser-like environments.\n *\n * @default true\n */\n omitQuotes?: boolean;\n\n /**\n * The name of the runtime module to import the methods from.\n *\n * @default \"solid-js/web\"\n */\n moduleName?: string;\n\n /**\n * The output mode of the compiler.\n * Can be:\n * - \"dom\" is standard output\n * - \"ssr\" is for server side rendering of strings.\n * - \"universal\" is for using custom renderers from solid-js/universal\n *\n * @default \"dom\"\n */\n generate?: 'ssr' | 'dom' | 'universal';\n\n /**\n * Indicate whether the output should contain hydratable markers.\n *\n * @default false\n */\n hydratable?: boolean;\n\n /**\n * Boolean to indicate whether to enable automatic event delegation on camelCase.\n *\n * @default true\n */\n delegateEvents?: boolean;\n\n /**\n * Boolean indicates whether smart conditional detection should be used.\n * This optimizes simple boolean expressions and ternaries in JSX.\n *\n * @default true\n */\n wrapConditionals?: boolean;\n\n /**\n * Boolean indicates whether to set current render context on Custom Elements and slots.\n * Useful for seemless Context API with Web Components.\n *\n * @default true\n */\n contextToCustomElements?: boolean;\n\n /**\n * Array of Component exports from module, that aren't included by default with the library.\n * This plugin will automatically import them if it comes across them in the JSX.\n *\n * @default [\"For\",\"Show\",\"Switch\",\"Match\",\"Suspense\",\"SuspenseList\",\"Portal\",\"Index\",\"Dynamic\",\"ErrorBoundary\"]\n */\n builtIns?: string[];\n\n /**\n * Enable dev-mode compilation output. When true, the compiler emits\n * additional runtime checks (e.g. hydration mismatch assertions).\n * Automatically set to true during `vite dev` — override here to\n * force on or off.\n *\n * @default auto (true in dev, false in build)\n */\n dev?: boolean;\n };\n\n\n refresh: Omit<RefreshOptions & { disabled: boolean }, 'bundler' | 'fixRender' | 'jsx'>;\n}\n\nfunction getExtension(filename: string): string {\n const index = filename.lastIndexOf('.');\n return index < 0 ? '' : filename.substring(index).replace(/\\?.+$/, '');\n}\nfunction containsSolidField(fields: Record<string, any>) {\n const keys = Object.keys(fields);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n if (key === 'solid') return true;\n if (typeof fields[key] === 'object' && fields[key] != null && containsSolidField(fields[key]))\n return true;\n }\n return false;\n}\n\nfunction getJestDomExport(setupFiles: string[]) {\n return setupFiles?.some((path) => /jest-dom/.test(path))\n ? undefined\n : ['@testing-library/jest-dom/vitest', '@testing-library/jest-dom/extend-expect'].find(\n (path) => {\n try {\n require.resolve(path);\n return true;\n } catch (e) {\n return false;\n }\n },\n );\n}\n\nexport default function solidPlugin(options: Partial<Options> = {}): Plugin {\n const filter = createFilter(options.include, options.exclude);\n\n let needHmr = false;\n let replaceDev = false;\n let projectRoot = process.cwd();\n let isTestMode = false;\n let isBuild = false;\n let base = '/';\n let solidPkgsConfig: Awaited<ReturnType<typeof crawlFrameworkPkgs>>;\n\n return {\n name: 'solid',\n enforce: 'pre',\n\n async config(userConfig, { command }) {\n // We inject the dev mode only if the user explicitly wants it or if we are in dev (serve) mode\n replaceDev = options.dev === true || (options.dev !== false && command === 'serve');\n projectRoot = userConfig.root || projectRoot;\n isTestMode = userConfig.mode === 'test';\n\n if (!userConfig.resolve) userConfig.resolve = {};\n userConfig.resolve.alias = normalizeAliases(userConfig.resolve && userConfig.resolve.alias);\n\n solidPkgsConfig = await crawlFrameworkPkgs({\n viteUserConfig: userConfig,\n root: projectRoot || process.cwd(),\n isBuild: command === 'build',\n isFrameworkPkgByJson(pkgJson) {\n return containsSolidField(pkgJson.exports || {});\n },\n });\n\n // fix for bundling dev in production\n const nestedDeps = replaceDev\n ? ['solid-js', '@solidjs/web']\n : [];\n\n const userTest = (userConfig as any).test ?? {};\n const test = {} as any;\n if (userConfig.mode === 'test') {\n // to simplify the processing of the config, we normalize the setupFiles to an array\n const userSetupFiles: string[] =\n typeof userTest.setupFiles === 'string'\n ? [userTest.setupFiles]\n : userTest.setupFiles || [];\n\n if (!userTest.environment && !options.ssr) {\n test.environment = 'jsdom';\n }\n\n if (\n !userTest.server?.deps?.external?.find((item: string | RegExp) =>\n /solid-js/.test(item.toString()),\n )\n ) {\n test.server = { deps: { external: [/solid-js/] } };\n }\n if (!userTest.browser?.enabled) {\n // vitest browser mode already has bundled jest-dom assertions\n // https://main.vitest.dev/guide/browser/assertion-api.html#assertion-api\n const jestDomImport = getJestDomExport(userSetupFiles);\n if (jestDomImport) {\n test.setupFiles = [jestDomImport];\n }\n }\n }\n\n return {\n /**\n * We only need esbuild on .ts or .js files.\n * .tsx & .jsx files are handled by us\n */\n // esbuild: { include: /\\.ts$/ },\n resolve: {\n conditions: isVite6\n ? undefined\n : [\n 'solid',\n ...(replaceDev ? ['development'] : []),\n ...(userConfig.mode === 'test' && !options.ssr ? ['browser'] : []),\n ],\n dedupe: nestedDeps,\n alias: [{ find: /^solid-refresh$/, replacement: runtimePublicPath }],\n },\n optimizeDeps: {\n include: [...nestedDeps, ...solidPkgsConfig.optimizeDeps.include],\n exclude: solidPkgsConfig.optimizeDeps.exclude,\n },\n ...(!isVite6 ? { ssr: solidPkgsConfig.ssr } : {}),\n ...(test.server ? { test } : {}),\n };\n },\n\n // @ts-ignore This hook only works in Vite 6\n async configEnvironment(name, config, opts) {\n config.resolve ??= {};\n // Emulate Vite default fallback for `resolve.conditions` if not set\n if (config.resolve.conditions == null) {\n // @ts-ignore These exports only exist in Vite 6\n const { defaultClientConditions, defaultServerConditions } = await import('vite');\n if (config.consumer === 'client' || name === 'client' || opts.isSsrTargetWebworker) {\n config.resolve.conditions = [...defaultClientConditions];\n } else {\n config.resolve.conditions = [...defaultServerConditions];\n }\n }\n config.resolve.conditions = [\n 'solid',\n ...(replaceDev ? ['development'] : []),\n ...(isTestMode && !opts.isSsrTargetWebworker && !options.ssr ? ['browser'] : []),\n ...config.resolve.conditions,\n ];\n\n // Set resolve.noExternal and resolve.external for SSR environment (Vite 6+)\n // Only set resolve.external if noExternal is not true (to avoid conflicts with plugins like Cloudflare)\n if (isVite6 && name === 'ssr' && solidPkgsConfig) {\n if (config.resolve.noExternal !== true) {\n config.resolve.noExternal = [\n ...(Array.isArray(config.resolve.noExternal) ? config.resolve.noExternal : []),\n ...solidPkgsConfig.ssr.noExternal,\n ];\n config.resolve.external = [\n ...(Array.isArray(config.resolve.external) ? config.resolve.external : []),\n ...solidPkgsConfig.ssr.external,\n ];\n }\n }\n },\n\n configResolved(config) {\n isBuild = config.command === 'build';\n base = config.base;\n needHmr = config.command === 'serve' && config.mode !== 'production' && (options.hot !== false && !options.refresh?.disabled);\n },\n\n configureServer(server) {\n if (!needHmr) return;\n // When a module has a syntax error, Vite sends the error overlay via\n // WebSocket but the failed import triggers invalidation in solid-refresh.\n // This propagates up to @refresh reload boundaries (e.g. document-level\n // App components in SSR), causing a full-reload that overrides the overlay.\n // We suppress update/full-reload messages that immediately follow an error.\n const hot = server.hot ?? (server as any).ws;\n if (!hot) return;\n let lastErrorTime = 0;\n const origSend = hot.send.bind(hot);\n hot.send = function (this: any, ...args: any[]) {\n const payload = args[0];\n if (typeof payload === 'object' && payload) {\n if (payload.type === 'error') {\n lastErrorTime = Date.now();\n } else if (lastErrorTime && (payload.type === 'full-reload' || payload.type === 'update')) {\n if (Date.now() - lastErrorTime < 200) return;\n lastErrorTime = 0;\n }\n }\n return origSend(...args);\n } as typeof hot.send;\n },\n\n hotUpdate() {\n // solid-refresh only injects HMR boundaries into client modules, so\n // non-client environments have no accept handlers. Without this, Vite\n // would see no boundaries and send full-reload messages that race with\n // client-side HMR updates.\n if (this.environment.name !== 'client') {\n return [];\n }\n },\n\n resolveId(id) {\n if (id === runtimePublicPath) return id;\n if (id === VIRTUAL_MANIFEST_ID) return RESOLVED_VIRTUAL_MANIFEST_ID;\n },\n\n load(id) {\n if (id === runtimePublicPath) return runtimeCode;\n if (id === RESOLVED_VIRTUAL_MANIFEST_ID) {\n if (!isBuild) return DEV_MANIFEST_CODE;\n const manifestPath = path.resolve(projectRoot, 'dist/client/.vite/manifest.json');\n if (existsSync(manifestPath)) {\n const manifest = JSON.parse(readFileSync(manifestPath, 'utf-8'));\n manifest._base = base;\n return `export default ${JSON.stringify(manifest)};`;\n }\n return DEV_MANIFEST_CODE;\n }\n },\n\n async transform(source, id, transformOptions) {\n const isSsr = transformOptions && transformOptions.ssr;\n const currentFileExtension = getExtension(id);\n\n const extensionsToWatch = options.extensions || [];\n const allExtensions = extensionsToWatch.map((extension) =>\n // An extension can be a string or a tuple [extension, options]\n typeof extension === 'string' ? extension : extension[0],\n );\n\n if (!filter(id)) {\n return null;\n }\n\n id = id.replace(/\\?.*$/, '');\n\n if (!(/\\.[mc]?[tj]sx$/i.test(id) || allExtensions.includes(currentFileExtension))) {\n return null;\n }\n\n const inNodeModules = /node_modules/.test(id);\n\n let solidOptions: { generate: 'ssr' | 'dom'; hydratable: boolean };\n\n if (options.ssr) {\n if (isSsr) {\n solidOptions = { generate: 'ssr', hydratable: true };\n } else {\n solidOptions = { generate: 'dom', hydratable: true };\n }\n } else {\n solidOptions = { generate: 'dom', hydratable: false };\n }\n\n // We need to know if the current file extension has a typescript options tied to it\n const shouldBeProcessedWithTypescript =\n /\\.[mc]?tsx$/i.test(id) ||\n extensionsToWatch.some((extension) => {\n if (typeof extension === 'string') {\n return extension.includes('tsx');\n }\n\n const [extensionName, extensionOptions] = extension;\n if (extensionName !== currentFileExtension) return false;\n\n return extensionOptions.typescript;\n });\n const plugins: NonNullable<NonNullable<babel.TransformOptions['parserOpts']>['plugins']> = [\n 'jsx',\n 'decorators',\n ];\n\n if (shouldBeProcessedWithTypescript) {\n plugins.push('typescript');\n }\n\n const opts: babel.TransformOptions = {\n root: projectRoot,\n filename: id,\n sourceFileName: id,\n presets: [[solid, { ...solidOptions, dev: replaceDev, ...(options.solid || {}) }]],\n plugins: [\n [lazyModuleUrl],\n ...(needHmr && !isSsr && !inNodeModules ? [[solidRefresh, {\n ...(options.refresh || {}),\n bundler: 'vite',\n fixRender: true,\n // TODO unfortunately, even with SSR enabled for refresh\n // it still doesn't work, so now we have to disable\n // this config\n jsx: false,\n }]] : []),\n ],\n ast: false,\n sourceMaps: true,\n configFile: false,\n babelrc: false,\n parserOpts: {\n plugins,\n },\n };\n\n // Default value for babel user options\n let babelUserOptions: babel.TransformOptions = {};\n\n if (options.babel) {\n if (typeof options.babel === 'function') {\n const babelOptions = options.babel(source, id, !!isSsr);\n babelUserOptions = babelOptions instanceof Promise ? await babelOptions : babelOptions;\n } else {\n babelUserOptions = options.babel;\n }\n }\n\n const babelOptions = mergeAndConcat(babelUserOptions, opts) as babel.TransformOptions;\n\n const result = await babel.transformAsync(source, babelOptions);\n if (!result) {\n return undefined;\n }\n\n let code = result.code || '';\n\n // Resolve lazy() moduleUrl placeholders using Vite's resolver\n const placeholderRe = new RegExp(\n '\"' + LAZY_PLACEHOLDER_PREFIX + '([^\"]+)\"',\n 'g',\n );\n let match;\n const resolutions: Array<{ placeholder: string; resolved: string }> = [];\n while ((match = placeholderRe.exec(code)) !== null) {\n const specifier = match[1];\n const resolved = await this.resolve(specifier, id);\n if (resolved) {\n const cleanId = resolved.id.split('?')[0];\n resolutions.push({\n placeholder: match[0],\n resolved: '\"' + path.relative(projectRoot, cleanId) + '\"',\n });\n }\n }\n for (const { placeholder, resolved } of resolutions) {\n code = code.replace(placeholder, resolved);\n }\n\n return { code, map: result.map };\n },\n };\n}\n\n/**\n * This basically normalize all aliases of the config into\n * the array format of the alias.\n *\n * eg: alias: { '@': 'src/' } => [{ find: '@', replacement: 'src/' }]\n */\nfunction normalizeAliases(alias: AliasOptions = []): Alias[] {\n return Array.isArray(alias)\n ? alias\n : Object.entries(alias).map(([find, replacement]) => ({ find, replacement }));\n}\n\nexport type ViteManifest = Record<\n string,\n {\n file: string;\n css?: string[];\n isEntry?: boolean;\n isDynamicEntry?: boolean;\n imports?: string[];\n }\n> & {\n _base?: string;\n};\n"],"names":["LAZY_PLACEHOLDER_PREFIX","extractDynamicImportSpecifier","node","type","callExpr","body","length","argument","callee","arguments","arg","value","lazyModuleUrlPlugin","name","visitor","CallExpression","nodePath","state","filename","binding","scope","getBinding","kind","bindingPath","path","parent","source","specifier","push","require","createRequire","import","meta","url","runtimePublicPath","runtimeFilePath","resolve","runtimeCode","readFileSync","isVite6","version","split","VIRTUAL_MANIFEST_ID","RESOLVED_VIRTUAL_MANIFEST_ID","DEV_MANIFEST_CODE","getExtension","index","lastIndexOf","substring","replace","containsSolidField","fields","keys","Object","i","key","getJestDomExport","setupFiles","some","test","undefined","find","e","solidPlugin","options","filter","createFilter","include","exclude","needHmr","replaceDev","projectRoot","process","cwd","isTestMode","isBuild","base","solidPkgsConfig","enforce","config","userConfig","command","dev","root","mode","alias","normalizeAliases","crawlFrameworkPkgs","viteUserConfig","isFrameworkPkgByJson","pkgJson","exports","nestedDeps","userTest","userSetupFiles","environment","ssr","server","deps","external","item","toString","browser","enabled","jestDomImport","conditions","dedupe","replacement","optimizeDeps","configEnvironment","opts","defaultClientConditions","defaultServerConditions","consumer","isSsrTargetWebworker","noExternal","Array","isArray","configResolved","hot","refresh","disabled","configureServer","ws","lastErrorTime","origSend","send","bind","args","payload","Date","now","hotUpdate","resolveId","id","load","manifestPath","existsSync","manifest","JSON","parse","_base","stringify","transform","transformOptions","isSsr","currentFileExtension","extensionsToWatch","extensions","allExtensions","map","extension","includes","inNodeModules","solidOptions","generate","hydratable","shouldBeProcessedWithTypescript","extensionName","extensionOptions","typescript","plugins","sourceFileName","presets","solid","lazyModuleUrl","solidRefresh","bundler","fixRender","jsx","ast","sourceMaps","configFile","babelrc","parserOpts","babelUserOptions","babel","babelOptions","Promise","mergeAndConcat","result","transformAsync","code","placeholderRe","RegExp","match","resolutions","exec","resolved","cleanId","placeholder","relative","entries"],"mappings":";;;;;;;;;;AAEO,MAAMA,uBAAuB,GAAG,wBAAwB;;AAE/D;AACA;AACA;AACA;AACA,SAASC,6BAA6BA,CAACC,IAAY,EAAiB;AAClE,EAAA,IAAIA,IAAI,CAACC,IAAI,KAAK,yBAAyB,IAAID,IAAI,CAACC,IAAI,KAAK,oBAAoB,EAAE,OAAO,IAAI;EAE9F,IAAIC,QAAiC,GAAG,IAAI;AAC5C,EAAA,IAAIF,IAAI,CAACG,IAAI,CAACF,IAAI,KAAK,gBAAgB,EAAE;IACvCC,QAAQ,GAAGF,IAAI,CAACG,IAAI;GACrB,MAAM,IACLH,IAAI,CAACG,IAAI,CAACF,IAAI,KAAK,gBAAgB,IACnCD,IAAI,CAACG,IAAI,CAACA,IAAI,CAACC,MAAM,KAAK,CAAC,IAC3BJ,IAAI,CAACG,IAAI,CAACA,IAAI,CAAC,CAAC,CAAC,CAACF,IAAI,KAAK,iBAAiB,IAC5CD,IAAI,CAACG,IAAI,CAACA,IAAI,CAAC,CAAC,CAAC,CAACE,QAAQ,EAAEJ,IAAI,KAAK,gBAAgB,EACrD;IACAC,QAAQ,GAAGF,IAAI,CAACG,IAAI,CAACA,IA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AG,CAAC,CAAC,CAACzF,IAAI,EAAE8C,WAAW,CAAC,MAAM;IAAE9C,IAAI;AAAE8C,IAAAA;AAAY,GAAC,CAAC,CAAC;AACjF;;;;"}
|
|
@@ -151,11 +151,6 @@ export type ViteManifest = Record<string, {
|
|
|
151
151
|
isEntry?: boolean;
|
|
152
152
|
isDynamicEntry?: boolean;
|
|
153
153
|
imports?: string[];
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
* In production, reads and caches the manifest JSON from `manifestPath`.
|
|
158
|
-
* In development (file not found), returns a proxy that maps each moduleUrl
|
|
159
|
-
* to its dev server path, so lazy() asset resolution works without a build.
|
|
160
|
-
*/
|
|
161
|
-
export declare function getManifest(manifestPath?: string): ViteManifest;
|
|
154
|
+
}> & {
|
|
155
|
+
_base?: string;
|
|
156
|
+
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-solid",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.2",
|
|
4
4
|
"description": "solid-js integration plugin for vite 3/4/5/6/7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
|
-
"dist"
|
|
7
|
+
"dist",
|
|
8
|
+
"virtual-solid-manifest.d.ts"
|
|
8
9
|
],
|
|
9
10
|
"main": "dist/cjs/index.cjs",
|
|
10
11
|
"module": "dist/esm/index.mjs",
|
|
@@ -37,9 +38,9 @@
|
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@babel/core": "^7.23.3",
|
|
39
40
|
"@types/babel__core": "^7.20.4",
|
|
40
|
-
"babel-preset-solid": "
|
|
41
|
+
"babel-preset-solid": ">=2.0.0-beta.0 <2.0.0",
|
|
41
42
|
"merge-anything": "^5.1.7",
|
|
42
|
-
"solid-refresh": "
|
|
43
|
+
"solid-refresh": ">=0.8.0-next.2 < 0.8.0",
|
|
43
44
|
"vitefu": "^1.0.4"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
@@ -58,13 +59,13 @@
|
|
|
58
59
|
"prettier": "^3.1.0",
|
|
59
60
|
"rollup": "^4.5.0",
|
|
60
61
|
"rollup-plugin-cleaner": "^1.0.0",
|
|
61
|
-
"solid-js": "
|
|
62
|
+
"solid-js": "2.0.0-beta.0",
|
|
62
63
|
"typescript": "^5.2.2",
|
|
63
64
|
"vite": "^7.0.0"
|
|
64
65
|
},
|
|
65
66
|
"peerDependencies": {
|
|
66
67
|
"@testing-library/jest-dom": "^5.16.6 || ^5.17.0 || ^6.*",
|
|
67
|
-
"solid-js": "
|
|
68
|
+
"solid-js": ">=2.0.0-beta.0 <2.0.0",
|
|
68
69
|
"vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
69
70
|
},
|
|
70
71
|
"peerDependenciesMeta": {
|