budibase/packages/standard-components/node_modules/@sveltejs/vite-plugin-svelte/dist/index.cjs.map

8 lines
75 KiB
Plaintext

{
"version": 3,
"sources": ["../src/index.ts", "../src/utils/log.ts", "../src/handle-hot-update.ts", "../src/utils/compile.ts", "../src/utils/hash.ts", "../src/utils/id.ts", "../src/utils/options.ts", "../src/utils/load-svelte-config.ts", "../src/utils/constants.ts", "../src/utils/vite-plugin-svelte-cache.ts", "../src/utils/watch.ts", "../src/utils/resolve.ts", "../src/utils/preprocess.ts", "../src/utils/sourcemap.ts"],
"sourcesContent": ["import fs from 'fs';\nimport { HmrContext, ModuleNode, Plugin, ResolvedConfig, UserConfig } from 'vite';\nimport { handleHotUpdate } from './handle-hot-update';\nimport { log, logCompilerWarnings } from './utils/log';\nimport { CompileData, createCompileSvelte } from './utils/compile';\nimport { buildIdParser, IdParser, SvelteRequest } from './utils/id';\nimport {\n\tbuildExtraViteConfig,\n\tvalidateInlineOptions,\n\tOptions,\n\tResolvedOptions,\n\tresolveOptions\n} from './utils/options';\nimport { VitePluginSvelteCache } from './utils/vite-plugin-svelte-cache';\n\nimport { setupWatchers } from './utils/watch';\nimport { resolveViaPackageJsonSvelte } from './utils/resolve';\nimport { addExtraPreprocessors } from './utils/preprocess';\nimport { PartialResolvedId } from 'rollup';\n\nexport function svelte(inlineOptions?: Partial<Options>): Plugin {\n\tif (process.env.DEBUG != null) {\n\t\tlog.setLevel('debug');\n\t}\n\tvalidateInlineOptions(inlineOptions);\n\tconst cache = new VitePluginSvelteCache();\n\tconst pkg_export_errors = new Set();\n\t// updated in configResolved hook\n\tlet requestParser: IdParser;\n\tlet options: ResolvedOptions;\n\tlet viteConfig: ResolvedConfig;\n\t/* eslint-disable no-unused-vars */\n\tlet compileSvelte: (\n\t\tsvelteRequest: SvelteRequest,\n\t\tcode: string,\n\t\toptions: Partial<ResolvedOptions>\n\t) => Promise<CompileData>;\n\t/* eslint-enable no-unused-vars */\n\n\tlet resolvedSvelteSSR: Promise<PartialResolvedId | null>;\n\n\treturn {\n\t\tname: 'vite-plugin-svelte',\n\t\t// make sure our resolver runs before vite internal resolver to resolve svelte field correctly\n\t\tenforce: 'pre',\n\t\tasync config(config, configEnv): Promise<Partial<UserConfig>> {\n\t\t\t// setup logger\n\t\t\tif (process.env.DEBUG) {\n\t\t\t\tlog.setLevel('debug');\n\t\t\t} else if (config.logLevel) {\n\t\t\t\tlog.setLevel(config.logLevel);\n\t\t\t}\n\t\t\toptions = await resolveOptions(inlineOptions, config, configEnv);\n\t\t\t// extra vite config\n\t\t\tconst extraViteConfig = buildExtraViteConfig(options, config);\n\t\t\tlog.debug('additional vite config', extraViteConfig);\n\t\t\treturn extraViteConfig as Partial<UserConfig>;\n\t\t},\n\n\t\tasync configResolved(config) {\n\t\t\taddExtraPreprocessors(options, config);\n\t\t\trequestParser = buildIdParser(options);\n\t\t\tcompileSvelte = createCompileSvelte(options);\n\t\t\tviteConfig = config;\n\t\t\tlog.debug('resolved options', options);\n\t\t},\n\n\t\tconfigureServer(server) {\n\t\t\t// eslint-disable-next-line no-unused-vars\n\t\t\toptions.server = server;\n\t\t\tsetupWatchers(options, cache, requestParser);\n\t\t},\n\n\t\tload(id, ssr) {\n\t\t\tconst svelteRequest = requestParser(id, !!ssr);\n\t\t\tif (svelteRequest) {\n\t\t\t\tconst { filename, query } = svelteRequest;\n\t\t\t\t// virtual css module\n\t\t\t\tif (query.svelte && query.type === 'style') {\n\t\t\t\t\tconst css = cache.getCSS(svelteRequest);\n\t\t\t\t\tif (css) {\n\t\t\t\t\t\tlog.debug(`load returns css for ${filename}`);\n\t\t\t\t\t\treturn css;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// prevent vite asset plugin from loading files as url that should be compiled in transform\n\t\t\t\tif (viteConfig.assetsInclude(filename)) {\n\t\t\t\t\tlog.debug(`load returns raw content for ${filename}`);\n\t\t\t\t\treturn fs.readFileSync(filename, 'utf-8');\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tasync resolveId(importee, importer, customOptions, ssr) {\n\t\t\tconst svelteRequest = requestParser(importee, !!ssr);\n\t\t\tif (svelteRequest?.query.svelte) {\n\t\t\t\tif (svelteRequest.query.type === 'style') {\n\t\t\t\t\t// return cssId with root prefix so postcss pipeline of vite finds the directory correctly\n\t\t\t\t\t// see https://github.com/sveltejs/vite-plugin-svelte/issues/14\n\t\t\t\t\tlog.debug(`resolveId resolved virtual css module ${svelteRequest.cssId}`);\n\t\t\t\t\treturn svelteRequest.cssId;\n\t\t\t\t}\n\t\t\t\tlog.debug(`resolveId resolved ${importee}`);\n\t\t\t\treturn importee; // query with svelte tag, an id we generated, no need for further analysis\n\t\t\t}\n\n\t\t\tif (ssr && importee === 'svelte') {\n\t\t\t\tif (!resolvedSvelteSSR) {\n\t\t\t\t\tresolvedSvelteSSR = this.resolve('svelte/ssr', undefined, { skipSelf: true }).then(\n\t\t\t\t\t\t(svelteSSR) => {\n\t\t\t\t\t\t\tlog.debug('resolved svelte to svelte/ssr');\n\t\t\t\t\t\t\treturn svelteSSR;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(err) => {\n\t\t\t\t\t\t\tlog.debug(\n\t\t\t\t\t\t\t\t'failed to resolve svelte to svelte/ssr. Update svelte to a version that exports it',\n\t\t\t\t\t\t\t\terr\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn null; // returning null here leads to svelte getting resolved regularly\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn resolvedSvelteSSR;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst resolved = resolveViaPackageJsonSvelte(importee, importer);\n\t\t\t\tif (resolved) {\n\t\t\t\t\tlog.debug(`resolveId resolved ${resolved} via package.json svelte field of ${importee}`);\n\t\t\t\t\treturn resolved;\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tswitch (err.code) {\n\t\t\t\t\tcase 'ERR_PACKAGE_PATH_NOT_EXPORTED':\n\t\t\t\t\t\tpkg_export_errors.add(importee);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\tcase 'MODULE_NOT_FOUND':\n\t\t\t\t\t\treturn null;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow err;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\tasync transform(code, id, ssr) {\n\t\t\tconst svelteRequest = requestParser(id, !!ssr);\n\t\t\tif (!svelteRequest) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst { filename, query } = svelteRequest;\n\n\t\t\tif (query.svelte) {\n\t\t\t\tif (query.type === 'style') {\n\t\t\t\t\tconst css = cache.getCSS(svelteRequest);\n\t\t\t\t\tif (css) {\n\t\t\t\t\t\tlog.debug(`transform returns css for ${filename}`);\n\t\t\t\t\t\treturn css; // TODO return code arg instead? it's the code from load hook.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlog.error('failed to transform tagged svelte request', svelteRequest);\n\t\t\t\tthrow new Error(`failed to transform tagged svelte request for id ${id}`);\n\t\t\t}\n\t\t\tconst compileData = await compileSvelte(svelteRequest, code, options);\n\t\t\tlogCompilerWarnings(compileData.compiled.warnings, options);\n\t\t\tcache.update(compileData);\n\t\t\tif (compileData.dependencies?.length && options.server) {\n\t\t\t\tcompileData.dependencies.forEach((d) => this.addWatchFile(d));\n\t\t\t}\n\t\t\tlog.debug(`transform returns compiled js for ${filename}`);\n\t\t\treturn compileData.compiled.js;\n\t\t},\n\n\t\thandleHotUpdate(ctx: HmrContext): void | Promise<Array<ModuleNode> | void> {\n\t\t\tif (!options.hot || !options.emitCss) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst svelteRequest = requestParser(ctx.file, false, ctx.timestamp);\n\t\t\tif (svelteRequest) {\n\t\t\t\treturn handleHotUpdate(compileSvelte, ctx, svelteRequest, cache, options);\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * All resolutions done; display warnings wrt `package.json` access.\n\t\t */\n\t\t// TODO generateBundle isn't called by vite, is buildEnd enough or should it be logged once per violation in resolve\n\t\tbuildEnd() {\n\t\t\tif (pkg_export_errors.size > 0) {\n\t\t\t\tlog.warn(\n\t\t\t\t\t`The following packages did not export their \\`package.json\\` file so we could not check the \"svelte\" field. If you had difficulties importing svelte components from a package, then please contact the author and ask them to export the package.json file.`,\n\t\t\t\t\tArray.from(pkg_export_errors, (s) => `- ${s}`).join('\\n')\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport {\n\tOptions,\n\tPreprocessor,\n\tPreprocessorGroup,\n\tCompileOptions,\n\tCssHashGetter,\n\tArrayable,\n\tMarkupPreprocessor,\n\tModuleFormat,\n\tProcessed,\n\tWarning\n} from './utils/options';\n", "/* eslint-disable no-unused-vars */\nimport { cyan, yellow, red } from 'kleur/colors';\nimport debug from 'debug';\nimport { ResolvedOptions, Warning } from './options';\n\nconst levels: string[] = ['debug', 'info', 'warn', 'error', 'silent'];\nconst prefix = 'vite-plugin-svelte';\nconst loggers: { [key: string]: any } = {\n\tdebug: {\n\t\tlog: debug(`vite:${prefix}`),\n\t\tenabled: false,\n\t\tisDebug: true\n\t},\n\tinfo: {\n\t\tcolor: cyan,\n\t\tlog: console.log,\n\t\tenabled: true\n\t},\n\twarn: {\n\t\tcolor: yellow,\n\t\tlog: console.warn,\n\t\tenabled: true\n\t},\n\terror: {\n\t\tcolor: red,\n\t\tlog: console.error,\n\t\tenabled: true\n\t},\n\tsilent: {\n\t\tenabled: false\n\t}\n};\n\nlet _level: string = 'info';\nfunction setLevel(level: string) {\n\tif (level === _level) {\n\t\treturn;\n\t}\n\tconst levelIndex = levels.indexOf(level);\n\tif (levelIndex > -1) {\n\t\t_level = level;\n\t\tfor (let i = 0; i < levels.length; i++) {\n\t\t\tloggers[levels[i]].enabled = i >= levelIndex;\n\t\t}\n\t} else {\n\t\t_log(loggers.error, `invalid log level: ${level} `);\n\t}\n}\n\nfunction _log(logger: any, message: string, payload?: any) {\n\tif (!logger.enabled) {\n\t\treturn;\n\t}\n\tif (logger.isDebug) {\n\t\tpayload !== undefined ? logger.log(message, payload) : logger.log(message);\n\t} else {\n\t\tlogger.log(logger.color(`${new Date().toLocaleTimeString()} [${prefix}] ${message}`));\n\t\tif (payload) {\n\t\t\tlogger.log(payload);\n\t\t}\n\t}\n}\n\nexport interface LogFn {\n\t(message: string, payload?: any): void;\n\tenabled: boolean;\n\tonce: (message: string, payload?: any) => void;\n}\n\nfunction createLogger(level: string): LogFn {\n\tconst logger = loggers[level];\n\tconst logFn: LogFn = _log.bind(null, logger) as LogFn;\n\tconst logged = new Set<String>();\n\tconst once = function (message: string, payload?: any) {\n\t\tif (logged.has(message)) {\n\t\t\treturn;\n\t\t}\n\t\tlogged.add(message);\n\t\tlogFn.apply(null, [message, payload]);\n\t};\n\tObject.defineProperty(logFn, 'enabled', {\n\t\tget() {\n\t\t\treturn logger.enabled;\n\t\t}\n\t});\n\tObject.defineProperty(logFn, 'once', {\n\t\tget() {\n\t\t\treturn once;\n\t\t}\n\t});\n\treturn logFn;\n}\n\nexport const log = {\n\tdebug: createLogger('debug'),\n\tinfo: createLogger('info'),\n\twarn: createLogger('warn'),\n\terror: createLogger('error'),\n\tsetLevel\n};\n\nexport function logCompilerWarnings(warnings: Warning[], options: ResolvedOptions) {\n\tconst { emitCss, onwarn, isBuild } = options;\n\tconst warn = isBuild ? warnBuild : warnDev;\n\twarnings?.forEach((warning) => {\n\t\tif (!emitCss && warning.code === 'css-unused-selector') {\n\t\t\treturn;\n\t\t}\n\t\tif (onwarn) {\n\t\t\tonwarn(warning, warn);\n\t\t} else {\n\t\t\twarn(warning);\n\t\t}\n\t});\n}\n\nfunction warnDev(w: Warning) {\n\tlog.info.enabled && log.info(buildExtendedLogMessage(w));\n}\n\nfunction warnBuild(w: Warning) {\n\tlog.warn.enabled && log.warn(buildExtendedLogMessage(w), w.frame);\n}\n\nfunction buildExtendedLogMessage(w: Warning) {\n\tconst parts = [];\n\tif (w.filename) {\n\t\tparts.push(w.filename);\n\t}\n\tif (w.start) {\n\t\tparts.push(':', w.start.line, ':', w.start.column);\n\t}\n\tif (w.message) {\n\t\tparts.push(' ', w.message);\n\t}\n\treturn parts.join('');\n}\n", "import { ModuleNode, HmrContext } from 'vite';\nimport { Code, CompileData } from './utils/compile';\nimport { log, logCompilerWarnings } from './utils/log';\nimport { SvelteRequest } from './utils/id';\nimport { VitePluginSvelteCache } from './utils/vite-plugin-svelte-cache';\nimport { ResolvedOptions } from './utils/options';\n\n/**\n * Vite-specific HMR handling\n */\nexport async function handleHotUpdate(\n\tcompileSvelte: Function,\n\tctx: HmrContext,\n\tsvelteRequest: SvelteRequest,\n\tcache: VitePluginSvelteCache,\n\toptions: ResolvedOptions\n): Promise<ModuleNode[] | void> {\n\tconst { read, server } = ctx;\n\n\tconst cachedJS = cache.getJS(svelteRequest);\n\tif (!cachedJS) {\n\t\t// file hasn't been requested yet (e.g. async component)\n\t\tlog.debug(`handleHotUpdate first call ${svelteRequest.id}`);\n\t\treturn;\n\t}\n\tconst cachedCss = cache.getCSS(svelteRequest);\n\n\tconst content = await read();\n\tconst compileData: CompileData = await compileSvelte(svelteRequest, content, options);\n\tcache.update(compileData);\n\n\tconst affectedModules = new Set<ModuleNode | undefined>();\n\n\tconst cssModule = server.moduleGraph.getModuleById(svelteRequest.cssId);\n\tconst mainModule = server.moduleGraph.getModuleById(svelteRequest.id);\n\tconst cssUpdated = cssModule && cssChanged(cachedCss, compileData.compiled.css);\n\tif (cssUpdated) {\n\t\tlog.debug('handleHotUpdate css changed');\n\t\taffectedModules.add(cssModule);\n\t}\n\tconst jsUpdated =\n\t\tmainModule && jsChanged(cachedJS, compileData.compiled.js, svelteRequest.filename);\n\tif (jsUpdated) {\n\t\tlog.debug('handleHotUpdate js changed');\n\t\taffectedModules.add(mainModule);\n\t}\n\n\tif (!jsUpdated) {\n\t\t// transform won't be called, log warnings here\n\t\tlogCompilerWarnings(compileData.compiled.warnings, options);\n\t}\n\n\tconst result = [...affectedModules].filter(Boolean) as ModuleNode[];\n\n\t// TODO is this enough? see also: https://github.com/vitejs/vite/issues/2274\n\tconst ssrModulesToInvalidate = result.filter((m) => !!m.ssrTransformResult);\n\tif (ssrModulesToInvalidate.length > 0) {\n\t\tlog.debug(`invalidating modules ${ssrModulesToInvalidate.map((m) => m.id).join(', ')}`);\n\t\tssrModulesToInvalidate.forEach((moduleNode) => server.moduleGraph.invalidateModule(moduleNode));\n\t}\n\tif (result.length > 0) {\n\t\tlog.debug(\n\t\t\t`handleHotUpdate for ${svelteRequest.id} result: ${result.map((m) => m.id).join(', ')}`\n\t\t);\n\t}\n\treturn result;\n}\n\nfunction cssChanged(prev?: Code, next?: Code): boolean {\n\treturn !isCodeEqual(prev?.code, next?.code);\n}\n\nfunction jsChanged(prev?: Code, next?: Code, filename?: string): boolean {\n\tconst prevJs = prev?.code;\n\tconst nextJs = next?.code;\n\tconst isStrictEqual = isCodeEqual(prevJs, nextJs);\n\tif (isStrictEqual) {\n\t\treturn false;\n\t}\n\tconst isLooseEqual = isCodeEqual(normalizeJsCode(prevJs), normalizeJsCode(nextJs));\n\tif (!isStrictEqual && isLooseEqual) {\n\t\tlog.warn(\n\t\t\t`ignoring compiler output js change for ${filename} as it is equal to previous output after normalization`\n\t\t);\n\t}\n\treturn !isLooseEqual;\n}\n\nfunction isCodeEqual(prev?: string, next?: string): boolean {\n\tif (!prev && !next) {\n\t\treturn true;\n\t}\n\tif ((!prev && next) || (prev && !next)) {\n\t\treturn false;\n\t}\n\treturn prev === next;\n}\n\n/**\n * remove code that only changes metadata and does not require a js update for the component to keep working\n *\n * 1) add_location() calls. These add location metadata to elements, only useful for tooling like sapper studio\n * 2) ... maybe more (or less) in the future\n * @param code\n */\nfunction normalizeJsCode(code?: string): string | undefined {\n\tif (!code) {\n\t\treturn code;\n\t}\n\treturn code.replace(/\\s*\\badd_location\\s*\\([^)]*\\)\\s*;?/g, '');\n}\n", "import { CompileOptions, ResolvedOptions } from './options';\nimport { compile, preprocess, walk } from 'svelte/compiler';\n// @ts-ignore\nimport { createMakeHot } from 'svelte-hmr';\nimport { SvelteRequest } from './id';\nimport { safeBase64Hash } from './hash';\nimport { log } from './log';\n\nconst _createCompileSvelte = (makeHot: Function) =>\n\tasync function compileSvelte(\n\t\tsvelteRequest: SvelteRequest,\n\t\tcode: string,\n\t\toptions: Partial<ResolvedOptions>\n\t): Promise<CompileData> {\n\t\tconst { filename, normalizedFilename, cssId, ssr } = svelteRequest;\n\t\tconst { emitCss = true } = options;\n\t\tconst dependencies = [];\n\n\t\tconst compileOptions: CompileOptions = {\n\t\t\t...options.compilerOptions,\n\t\t\tfilename,\n\t\t\tgenerate: ssr ? 'ssr' : 'dom'\n\t\t};\n\t\tif (options.hot && options.emitCss) {\n\t\t\tconst hash = `s-${safeBase64Hash(normalizedFilename)}`;\n\t\t\tlog.debug(`setting cssHash ${hash} for ${normalizedFilename}`);\n\t\t\tcompileOptions.cssHash = () => hash;\n\t\t}\n\n\t\tlet preprocessed;\n\n\t\tif (options.preprocess) {\n\t\t\tpreprocessed = await preprocess(code, options.preprocess, { filename });\n\t\t\tif (preprocessed.dependencies) dependencies.push(...preprocessed.dependencies);\n\t\t\tif (preprocessed.map) compileOptions.sourcemap = preprocessed.map;\n\t\t}\n\t\tconst finalCode = preprocessed ? preprocessed.code : code;\n\t\tconst dynamicCompileOptions = await options.experimental?.dynamicCompileOptions?.({\n\t\t\tfilename,\n\t\t\tcode: finalCode,\n\t\t\tcompileOptions\n\t\t});\n\t\tif (dynamicCompileOptions && log.debug.enabled) {\n\t\t\tlog.debug(\n\t\t\t\t`dynamic compile options for ${filename}: ${JSON.stringify(dynamicCompileOptions)}`\n\t\t\t);\n\t\t}\n\t\tconst finalCompileOptions = dynamicCompileOptions\n\t\t\t? {\n\t\t\t\t\t...compileOptions,\n\t\t\t\t\t...dynamicCompileOptions\n\t\t\t }\n\t\t\t: compileOptions;\n\t\tconst compiled = compile(finalCode, finalCompileOptions);\n\n\t\tif (emitCss && compiled.css.code) {\n\t\t\t// TODO properly update sourcemap?\n\t\t\tcompiled.js.code += `\\nimport ${JSON.stringify(cssId)};\\n`;\n\t\t}\n\n\t\t// only apply hmr when not in ssr context and hot options are set\n\t\tif (!ssr && makeHot) {\n\t\t\tcompiled.js.code = makeHot({\n\t\t\t\tid: filename,\n\t\t\t\tcompiledCode: compiled.js.code,\n\t\t\t\thotOptions: options.hot,\n\t\t\t\tcompiled,\n\t\t\t\toriginalCode: code,\n\t\t\t\tcompileOptions: finalCompileOptions\n\t\t\t});\n\t\t}\n\n\t\tcompiled.js.dependencies = dependencies;\n\n\t\treturn {\n\t\t\tfilename,\n\t\t\tnormalizedFilename,\n\t\t\t// @ts-ignore\n\t\t\tcompiled,\n\t\t\tssr,\n\t\t\tdependencies\n\t\t};\n\t};\n\nfunction buildMakeHot(options: ResolvedOptions) {\n\tconst needsMakeHot = options.hot !== false && options.isServe && !options.isProduction;\n\tif (needsMakeHot) {\n\t\t// @ts-ignore\n\t\tconst hotApi = options?.hot?.hotApi;\n\t\t// @ts-ignore\n\t\tconst adapter = options?.hot?.adapter;\n\t\treturn createMakeHot({\n\t\t\twalk,\n\t\t\thotApi,\n\t\t\tadapter,\n\t\t\thotOptions: { noOverlay: true, ...(options.hot as object) }\n\t\t});\n\t}\n}\n\nexport function createCompileSvelte(options: ResolvedOptions) {\n\tconst makeHot = buildMakeHot(options);\n\treturn _createCompileSvelte(makeHot);\n}\n\nexport interface Code {\n\tcode: string;\n\tmap?: any;\n\tdependencies?: any[];\n}\n\nexport interface Compiled {\n\tjs: Code;\n\tcss: Code;\n\tast: any; // TODO type\n\twarnings: any[]; // TODO type\n\tvars: {\n\t\tname: string;\n\t\texport_name: string;\n\t\tinjected: boolean;\n\t\tmodule: boolean;\n\t\tmutated: boolean;\n\t\treassigned: boolean;\n\t\treferenced: boolean;\n\t\twritable: boolean;\n\t\treferenced_from_script: boolean;\n\t}[];\n\tstats: {\n\t\ttimings: {\n\t\t\ttotal: number;\n\t\t};\n\t};\n}\n\nexport interface CompileData {\n\tfilename: string;\n\tnormalizedFilename: string;\n\tcompiled: Compiled;\n\tssr: boolean | undefined;\n\tdependencies: string[];\n}\n", "import * as crypto from 'crypto';\n\nconst hashes = Object.create(null);\n\n//TODO shorter?\nconst hash_length = 12;\n\nexport function safeBase64Hash(input: string) {\n\tif (hashes[input]) {\n\t\treturn hashes[input];\n\t}\n\t//TODO if performance really matters, use a faster one like xx-hash etc.\n\t// should be evenly distributed because short input length and similarities in paths could cause collisions otherwise\n\t// OR DON'T USE A HASH AT ALL, what about a simple counter?\n\tconst md5 = crypto.createHash('md5');\n\tmd5.update(input);\n\tconst hash = toSafe(md5.digest('base64')).substr(0, hash_length);\n\thashes[input] = hash;\n\treturn hash;\n}\n\nconst replacements: { [key: string]: string } = {\n\t'+': '-',\n\t'/': '_',\n\t'=': ''\n};\n\nconst replaceRE = new RegExp(`[${Object.keys(replacements).join('')}]`, 'g');\n\nfunction toSafe(base64: string) {\n\treturn base64.replace(replaceRE, (x) => replacements[x]);\n}\n", "/* eslint-disable no-unused-vars */\nimport { createFilter } from '@rollup/pluginutils';\nimport { Arrayable, ResolvedOptions } from './options';\nimport { normalizePath } from 'vite';\nimport * as fs from 'fs';\n\nconst VITE_FS_PREFIX = '/@fs/';\nconst IS_WINDOWS = process.platform === 'win32';\n\nexport type SvelteQueryTypes = 'style' | 'script';\n\nexport interface RequestQuery {\n\t// our own\n\tsvelte?: boolean;\n\ttype?: SvelteQueryTypes;\n\t// vite specific\n\turl?: boolean;\n\traw?: boolean;\n}\n\nexport interface SvelteRequest {\n\tid: string;\n\tcssId: string;\n\tfilename: string;\n\tnormalizedFilename: string;\n\tquery: RequestQuery;\n\ttimestamp: number;\n\tssr: boolean;\n}\n\nfunction splitId(id: string) {\n\tconst parts = id.split(`?`, 2);\n\tconst filename = parts[0];\n\tconst rawQuery = parts[1];\n\treturn { filename, rawQuery };\n}\n\nfunction parseToSvelteRequest(\n\tid: string,\n\tfilename: string,\n\trawQuery: string,\n\troot: string,\n\ttimestamp: number,\n\tssr: boolean\n): SvelteRequest | undefined {\n\tconst query = parseRequestQuery(rawQuery);\n\tif (query.url || query.raw) {\n\t\t// skip requests with special vite tags\n\t\treturn;\n\t}\n\tconst normalizedFilename = normalize(filename, root);\n\tconst cssId = createVirtualImportId(filename, root, 'style');\n\n\treturn {\n\t\tid,\n\t\tfilename,\n\t\tnormalizedFilename,\n\t\tcssId,\n\t\tquery,\n\t\ttimestamp,\n\t\tssr\n\t};\n}\n\nfunction createVirtualImportId(filename: string, root: string, type: SvelteQueryTypes) {\n\tconst parts = ['svelte', `type=${type}`];\n\tif (type === 'style') {\n\t\tparts.push('lang.css');\n\t}\n\tif (existsInRoot(filename, root)) {\n\t\tfilename = root + filename;\n\t} else if (filename.startsWith(VITE_FS_PREFIX)) {\n\t\tfilename = IS_WINDOWS\n\t\t\t? filename.slice(VITE_FS_PREFIX.length) // remove /@fs/ from /@fs/C:/...\n\t\t\t: filename.slice(VITE_FS_PREFIX.length - 1); // remove /@fs from /@fs/home/user\n\t}\n\t// return same virtual id format as vite-plugin-vue eg ...App.svelte?svelte&type=style&lang.css\n\treturn `${filename}?${parts.join('&')}`;\n}\n\nfunction parseRequestQuery(rawQuery: string): RequestQuery {\n\tconst query = Object.fromEntries(new URLSearchParams(rawQuery));\n\tfor (const key in query) {\n\t\tif (query[key] === '') {\n\t\t\t// @ts-ignore\n\t\t\tquery[key] = true;\n\t\t}\n\t}\n\treturn query as RequestQuery;\n}\n\n/**\n * posixify and remove root at start\n *\n * @param filename\n * @param normalizedRoot\n */\nfunction normalize(filename: string, normalizedRoot: string) {\n\treturn stripRoot(normalizePath(filename), normalizedRoot);\n}\n\nfunction existsInRoot(filename: string, root: string) {\n\tif (filename.startsWith(VITE_FS_PREFIX)) {\n\t\treturn false; // vite already tagged it as out of root\n\t}\n\treturn fs.existsSync(root + filename);\n}\n\nfunction stripRoot(normalizedFilename: string, normalizedRoot: string) {\n\treturn normalizedFilename.startsWith(normalizedRoot + '/')\n\t\t? normalizedFilename.slice(normalizedRoot.length)\n\t\t: normalizedFilename;\n}\n\nfunction buildFilter(\n\tinclude: Arrayable<string> | undefined,\n\texclude: Arrayable<string> | undefined,\n\textensions: string[]\n): (filename: string) => boolean {\n\tconst rollupFilter = createFilter(include, exclude);\n\treturn (filename) => rollupFilter(filename) && extensions.some((ext) => filename.endsWith(ext));\n}\n\nexport type IdParser = (id: string, ssr: boolean, timestamp?: number) => SvelteRequest | undefined;\nexport function buildIdParser(options: ResolvedOptions): IdParser {\n\tconst { include, exclude, extensions, root } = options;\n\tconst normalizedRoot = normalizePath(root);\n\tconst filter = buildFilter(include, exclude, extensions!);\n\treturn (id, ssr, timestamp = Date.now()) => {\n\t\tconst { filename, rawQuery } = splitId(id);\n\t\tif (filter(filename)) {\n\t\t\treturn parseToSvelteRequest(id, filename, rawQuery, normalizedRoot, timestamp, ssr);\n\t\t}\n\t};\n}\n", "/* eslint-disable no-unused-vars */\nimport { ConfigEnv, UserConfig, ViteDevServer, normalizePath } from 'vite';\nimport { log } from './log';\nimport { loadSvelteConfig } from './load-svelte-config';\nimport { SVELTE_HMR_IMPORTS, SVELTE_IMPORTS, SVELTE_RESOLVE_MAIN_FIELDS } from './constants';\n// eslint-disable-next-line node/no-missing-import\nimport { CompileOptions, Warning } from 'svelte/types/compiler/interfaces';\nimport {\n\tMarkupPreprocessor,\n\tPreprocessor,\n\tPreprocessorGroup,\n\tProcessed\n\t// eslint-disable-next-line node/no-missing-import\n} from 'svelte/types/compiler/preprocess';\nimport path from 'path';\n\nconst knownOptions = new Set([\n\t'configFile',\n\t'include',\n\t'exclude',\n\t'extensions',\n\t'emitCss',\n\t'compilerOptions',\n\t'onwarn',\n\t'preprocess',\n\t'hot',\n\t'ignorePluginPreprocessors',\n\t'experimental'\n]);\n\nfunction buildDefaultOptions(isProduction: boolean, options: Partial<Options>): Partial<Options> {\n\t// emit for prod, emit in dev unless css hmr is disabled\n\tconst emitCss = options?.emitCss != null ? options.emitCss : true;\n\t// no hmr in prod, only inject css in dev if emitCss is false\n\tconst hot = isProduction\n\t\t? false\n\t\t: {\n\t\t\t\tinjectCss: !emitCss\n\t\t };\n\tconst defaultOptions: Partial<Options> = {\n\t\textensions: ['.svelte'],\n\t\thot,\n\t\temitCss,\n\t\tcompilerOptions: {\n\t\t\tformat: 'esm',\n\t\t\tcss: !emitCss,\n\t\t\tdev: !isProduction\n\t\t}\n\t};\n\tlog.debug(`default options for ${isProduction ? 'production' : 'development'}`, defaultOptions);\n\treturn defaultOptions;\n}\n\nexport function validateInlineOptions(inlineOptions?: Partial<Options>) {\n\tconst invalidKeys = Object.keys(inlineOptions || {}).filter((key) => !knownOptions.has(key));\n\tif (invalidKeys.length) {\n\t\tlog.warn(`invalid plugin options \"${invalidKeys.join(', ')}\" in config`, inlineOptions);\n\t}\n}\n\nfunction enforceOptionsForHmr(options: ResolvedOptions) {\n\tif (options.hot) {\n\t\tif (!options.compilerOptions.dev) {\n\t\t\tlog.warn('hmr is enabled but compilerOptions.dev is false, forcing it to true');\n\t\t\toptions.compilerOptions.dev = true;\n\t\t}\n\t\tif (options.emitCss) {\n\t\t\tif (options.hot !== true && options.hot.injectCss) {\n\t\t\t\tlog.warn('hmr and emitCss are enabled but hot.injectCss is true, forcing it to false');\n\t\t\t\toptions.hot.injectCss = false;\n\t\t\t}\n\t\t\tif (options.compilerOptions.css) {\n\t\t\t\tlog.warn(\n\t\t\t\t\t'hmr and emitCss are enabled but compilerOptions.css is true, forcing it to false'\n\t\t\t\t);\n\t\t\t\toptions.compilerOptions.css = false;\n\t\t\t}\n\t\t} else {\n\t\t\tif (options.hot === true || !options.hot.injectCss) {\n\t\t\t\tlog.warn(\n\t\t\t\t\t'hmr with emitCss disabled requires option hot.injectCss to be enabled, forcing it to true'\n\t\t\t\t);\n\t\t\t\tif (options.hot === true) {\n\t\t\t\t\toptions.hot = { injectCss: true };\n\t\t\t\t} else {\n\t\t\t\t\toptions.hot.injectCss = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!options.compilerOptions.css) {\n\t\t\t\tlog.warn(\n\t\t\t\t\t'hmr with emitCss disabled requires compilerOptions.css to be enabled, forcing it to true'\n\t\t\t\t);\n\t\t\t\toptions.compilerOptions.css = true;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction enforceOptionsForProduction(options: ResolvedOptions) {\n\tif (options.isProduction) {\n\t\tif (options.hot) {\n\t\t\tlog.warn('options.hot is enabled but does not work on production build, forcing it to false');\n\t\t\toptions.hot = false;\n\t\t}\n\t\tif (options.compilerOptions.dev) {\n\t\t\tlog.warn(\n\t\t\t\t'you are building for production but compilerOptions.dev is true, forcing it to false'\n\t\t\t);\n\t\t\toptions.compilerOptions.dev = false;\n\t\t}\n\t}\n}\n\nfunction mergeOptions(\n\tdefaultOptions: Partial<Options>,\n\tsvelteConfig: Partial<Options>,\n\tinlineOptions: Partial<Options>,\n\tviteConfig: UserConfig,\n\tviteEnv: ConfigEnv\n): ResolvedOptions {\n\tconst merged = {\n\t\t...defaultOptions,\n\t\t...svelteConfig,\n\t\t...inlineOptions,\n\t\tcompilerOptions: {\n\t\t\t...defaultOptions.compilerOptions,\n\t\t\t...(svelteConfig?.compilerOptions || {}),\n\t\t\t...(inlineOptions?.compilerOptions || {})\n\t\t},\n\t\texperimental: {\n\t\t\t...(svelteConfig?.experimental || {}),\n\t\t\t...(inlineOptions?.experimental || {})\n\t\t},\n\t\troot: viteConfig.root!,\n\t\tisProduction: viteEnv.mode === 'production',\n\t\tisBuild: viteEnv.command === 'build',\n\t\tisServe: viteEnv.command === 'serve'\n\t};\n\t// configFile of svelteConfig contains the absolute path it was loaded from,\n\t// prefer it over the possibly relative inline path\n\tif (svelteConfig?.configFile) {\n\t\tmerged.configFile = svelteConfig.configFile;\n\t}\n\treturn merged;\n}\n\nexport async function resolveOptions(\n\tinlineOptions: Partial<Options> = {},\n\tviteConfig: UserConfig,\n\tviteEnv: ConfigEnv\n): Promise<ResolvedOptions> {\n\tconst viteConfigWithResolvedRoot = {\n\t\t...viteConfig,\n\t\troot: resolveViteRoot(viteConfig)\n\t};\n\tconst defaultOptions = buildDefaultOptions(viteEnv.mode === 'production', inlineOptions);\n\tconst svelteConfig = (await loadSvelteConfig(viteConfigWithResolvedRoot, inlineOptions)) || {};\n\tconst resolvedOptions = mergeOptions(\n\t\tdefaultOptions,\n\t\tsvelteConfig,\n\t\tinlineOptions,\n\t\tviteConfigWithResolvedRoot,\n\t\tviteEnv\n\t);\n\n\tenforceOptionsForProduction(resolvedOptions);\n\tenforceOptionsForHmr(resolvedOptions);\n\treturn resolvedOptions;\n}\n\n// vite passes unresolved `root`option to config hook but we need the resolved value, so do it here\n// https://github.com/sveltejs/vite-plugin-svelte/issues/113\n// https://github.com/vitejs/vite/blob/43c957de8a99bb326afd732c962f42127b0a4d1e/packages/vite/src/node/config.ts#L293\nfunction resolveViteRoot(viteConfig: UserConfig): string | undefined {\n\treturn normalizePath(viteConfig.root ? path.resolve(viteConfig.root) : process.cwd());\n}\n\nexport function buildExtraViteConfig(\n\toptions: ResolvedOptions,\n\tconfig: UserConfig\n): Partial<UserConfig> {\n\tconst allSvelteImports = [...SVELTE_IMPORTS, ...SVELTE_HMR_IMPORTS];\n\n\t// exclude svelte imports from optimization unless explicitly included\n\tconst excludeFromOptimize = allSvelteImports.filter(\n\t\t(x) => !config.optimizeDeps?.include?.includes(x)\n\t);\n\n\tconst extraViteConfig: Partial<UserConfig> = {\n\t\toptimizeDeps: {\n\t\t\texclude: excludeFromOptimize\n\t\t},\n\t\tresolve: {\n\t\t\tmainFields: [...SVELTE_RESOLVE_MAIN_FIELDS],\n\t\t\tdedupe: allSvelteImports\n\t\t}\n\t\t// this option is still awaiting a PR in vite to be supported\n\t\t// see https://github.com/sveltejs/vite-plugin-svelte/issues/60\n\t\t// @ts-ignore\n\t\t// knownJsSrcExtensions: options.extensions\n\t};\n\n\tif (options.isBuild && config.build?.ssr) {\n\t\t// add svelte to ssr.noExternal unless it is present in ssr.external\n\t\t// so we can resolve it with svelte/ssr\n\t\t// @ts-ignore\n\t\tif (!config.ssr?.external?.includes('svelte')) {\n\t\t\t// @ts-ignore\n\t\t\textraViteConfig.ssr = {\n\t\t\t\tnoExternal: ['svelte']\n\t\t\t};\n\t\t}\n\t}\n\n\tif (options.experimental?.useVitePreprocess) {\n\t\t// needed to transform svelte files with component imports\n\t\t// can cause issues with other typescript files, see https://github.com/sveltejs/vite-plugin-svelte/pull/20\n\t\textraViteConfig.esbuild = {\n\t\t\ttsconfigRaw: {\n\t\t\t\tcompilerOptions: {\n\t\t\t\t\timportsNotUsedAsValues: 'preserve'\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n\treturn extraViteConfig;\n}\n\nexport interface Options {\n\t// eslint-disable no-unused-vars\n\t/** path to svelte config file, either absolute or relative to vite root*/\n\tconfigFile?: string;\n\n\t/** One or more minimatch patterns */\n\tinclude?: Arrayable<string>;\n\n\t/** One or more minimatch patterns */\n\texclude?: Arrayable<string>;\n\n\t/**\n\t * By default, all \".svelte\" files are compiled\n\t * @default ['.svelte']\n\t */\n\textensions?: string[];\n\n\t/**\n\t * Optionally, preprocess components with svelte.preprocess:\n\t * \\@see https://svelte.dev/docs#svelte_preprocess\n\t */\n\tpreprocess?: Arrayable<PreprocessorGroup>;\n\n\t/** Emit Svelte styles as virtual CSS files for other plugins to process.\n\t * @default true\n\t */\n\temitCss?: boolean;\n\n\t/** Options passed to `svelte.compile` method. */\n\tcompilerOptions: Partial<CompileOptions>;\n\n\t/**\n\t * custom warning handler for svelte compiler warnings\n\t */\n\tonwarn?: (warning: Warning, defaultHandler?: (warning: Warning) => void) => void;\n\n\t/**\n\t * enable/disable hmr. You want this enabled.\n\t *\n\t * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\t * DO NOT CUSTOMIZE SVELTE-HMR OPTIONS UNLESS YOU KNOW EXACTLY WHAT YOU ARE DOING\n\t *\n\t * YOU HAVE BEEN WARNED\n\t * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\t *\n\t * set to object to pass custom options to svelte-hmr, see https://github.com/rixo/svelte-hmr#options\n\t *\n\t * @default true for development, always false for production\n\t */\n\thot?: boolean | { injectCss?: boolean; [key: string]: any };\n\n\t/**\n\t * vite plugins can contribute additional preprocessors by defining api.sveltePreprocess.\n\t * If you don't want to use them, set this to true to ignore them all or use an array of strings with plugin names to specify which\n\t *\n\t * @default false\n\t */\n\tignorePluginPreprocessors?: boolean | string[];\n\n\t/**\n\t * These options are considered experimental and breaking changes to them can occur in any release\n\t */\n\texperimental?: ExperimentalOptions;\n}\n\n/**\n * These options are considered experimental and breaking changes to them can occur in any release\n */\nexport interface ExperimentalOptions {\n\t/**\n\t * use extra preprocessors that delegate style and typescript preproessing to native vite plugins\n\t *\n\t * do not use together with svelte-preprocess!\n\t *\n\t * @default false\n\t */\n\tuseVitePreprocess?: boolean;\n\n\t/**\n\t * wrap all preprocessors in with a function that adds a sourcemap to the output if missing\n\t *\n\t * to use this option you have to install \"diff-match-patch\"\n\t */\n\tgenerateMissingPreprocessorSourcemaps?: boolean;\n\n\t/**\n\t * function to update compilerOptions before compilation\n\t *\n\t * data.filename is the file to be compiled,\n\t * data.code is the already preprocessed code\n\t * data.compileOptions are the compilerOptions that are going to be used\n\t *\n\t * to change one, you should return an object with the changes you need, eg:\n\t *\n\t * ```\n\t * ({filename,compileOptions}) => { if( compileWithHydratable(filename) && !compileOptions.hydratable ){ return {hydratable: true}}}\n\t * ```\n\t * @default undefined\n\t */\n\tdynamicCompileOptions?: (data: {\n\t\tfilename: string;\n\t\tcode: string;\n\t\tcompileOptions: Partial<CompileOptions>;\n\t}) => Promise<Partial<CompileOptions> | void> | Partial<CompileOptions> | void;\n}\n\nexport interface ResolvedOptions extends Options {\n\troot: string;\n\tisProduction: boolean;\n\tisBuild?: boolean;\n\tisServe?: boolean;\n\tserver?: ViteDevServer;\n}\n\nexport type {\n\tCompileOptions,\n\tProcessed,\n\tMarkupPreprocessor,\n\tPreprocessor,\n\tPreprocessorGroup,\n\tWarning\n};\n\nexport type ModuleFormat = NonNullable<CompileOptions['format']>;\n\nexport type CssHashGetter = NonNullable<CompileOptions['cssHash']>;\n\nexport type Arrayable<T> = T | T[];\n", "import path from 'path';\nimport fs from 'fs';\nimport { pathToFileURL } from 'url';\nimport { log } from './log';\nimport { Options } from './options';\nimport { UserConfig } from 'vite';\n\nexport const knownSvelteConfigNames = [\n\t'svelte.config.js',\n\t'svelte.config.cjs',\n\t'svelte.config.mjs'\n];\n\n// hide dynamic import from ts transform to prevent it turning into a require\n// see https://github.com/microsoft/TypeScript/issues/43329#issuecomment-811606238\n// also use timestamp query to avoid caching on reload\nconst dynamicImportDefault = new Function(\n\t'path',\n\t'return import(path + \"?t=\" + Date.now()).then(m => m.default)'\n);\n\nexport async function loadSvelteConfig(\n\tviteConfig: UserConfig,\n\tinlineOptions: Partial<Options>\n): Promise<Partial<Options> | undefined> {\n\tconst configFile = findConfigToLoad(viteConfig, inlineOptions);\n\tif (configFile) {\n\t\tlet err;\n\t\t// try to use dynamic import for svelte.config.js first\n\t\tif (configFile.endsWith('.js') || configFile.endsWith('.mjs')) {\n\t\t\ttry {\n\t\t\t\tconst result = await dynamicImportDefault(pathToFileURL(configFile).href);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...result,\n\t\t\t\t\t\tconfigFile\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(`invalid export in ${configFile}`);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tlog.error(`failed to import config ${configFile}`, e);\n\t\t\t\terr = e;\n\t\t\t}\n\t\t}\n\t\t// cjs or error with dynamic import\n\t\tif (!configFile.endsWith('.mjs')) {\n\t\t\ttry {\n\t\t\t\t// avoid loading cached version on reload\n\t\t\t\tdelete require.cache[require.resolve(configFile)];\n\t\t\t\tconst result = require(configFile);\n\t\t\t\tif (result != null) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...result,\n\t\t\t\t\t\tconfigFile\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(`invalid export in ${configFile}`);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tlog.error(`failed to require config ${configFile}`, e);\n\t\t\t\tif (!err) {\n\t\t\t\t\terr = e;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// failed to load existing config file\n\t\tthrow err;\n\t}\n}\n\nfunction findConfigToLoad(viteConfig: UserConfig, inlineOptions: Partial<Options>) {\n\tconst root = viteConfig.root || process.cwd();\n\tif (inlineOptions.configFile) {\n\t\tconst abolutePath = path.isAbsolute(inlineOptions.configFile)\n\t\t\t? inlineOptions.configFile\n\t\t\t: path.resolve(root, inlineOptions.configFile);\n\t\tif (!fs.existsSync(abolutePath)) {\n\t\t\tthrow new Error(`failed to find svelte config file ${abolutePath}.`);\n\t\t}\n\t\treturn abolutePath;\n\t} else {\n\t\tconst existingKnownConfigFiles = knownSvelteConfigNames\n\t\t\t.map((candidate) => path.resolve(root, candidate))\n\t\t\t.filter((file) => fs.existsSync(file));\n\t\tif (existingKnownConfigFiles.length === 0) {\n\t\t\tlog.debug(`no svelte config found at ${root}`);\n\t\t\treturn;\n\t\t} else if (existingKnownConfigFiles.length > 1) {\n\t\t\tlog.warn(\n\t\t\t\t`found more than one svelte config file, using ${existingKnownConfigFiles[0]}. you should only have one!`,\n\t\t\t\texistingKnownConfigFiles\n\t\t\t);\n\t\t}\n\t\treturn existingKnownConfigFiles[0];\n\t}\n}\n", "const VITE_RESOLVE_MAIN_FIELDS = ['module', 'jsnext:main', 'jsnext'];\n\nexport const SVELTE_RESOLVE_MAIN_FIELDS = ['svelte', ...VITE_RESOLVE_MAIN_FIELDS];\n\nexport const SVELTE_IMPORTS = [\n\t'svelte/animate',\n\t'svelte/easing',\n\t'svelte/internal',\n\t'svelte/motion',\n\t'svelte/store',\n\t'svelte/transition',\n\t'svelte'\n];\n\nexport const SVELTE_HMR_IMPORTS = [\n\t'svelte-hmr/runtime/hot-api-esm.js',\n\t'svelte-hmr/runtime/proxy-adapter-dom.js',\n\t'svelte-hmr'\n];\n", "import { SvelteRequest } from './id';\nimport { Code, CompileData } from './compile';\n\nexport class VitePluginSvelteCache {\n\tprivate _css = new Map<string, Code>();\n\tprivate _js = new Map<string, Code>();\n\tprivate _dependencies = new Map<string, string[]>();\n\tprivate _dependants = new Map<string, Set<string>>();\n\n\tpublic update(compileData: CompileData) {\n\t\tthis.updateCSS(compileData);\n\t\tthis.updateJS(compileData);\n\t\tthis.updateDependencies(compileData);\n\t}\n\n\tprivate updateCSS(compileData: CompileData) {\n\t\tthis._css.set(compileData.normalizedFilename, compileData.compiled.css);\n\t}\n\n\tprivate updateJS(compileData: CompileData) {\n\t\tif (!compileData.ssr) {\n\t\t\t// do not cache SSR js\n\t\t\tthis._js.set(compileData.normalizedFilename, compileData.compiled.js);\n\t\t}\n\t}\n\n\tprivate updateDependencies(compileData: CompileData) {\n\t\tconst id = compileData.normalizedFilename;\n\t\tconst prevDependencies = this._dependencies.get(id) || [];\n\t\tconst dependencies = compileData.dependencies;\n\t\tthis._dependencies.set(id, dependencies);\n\t\tconst removed = prevDependencies.filter((d) => !dependencies.includes(d));\n\t\tconst added = dependencies.filter((d) => !prevDependencies.includes(d));\n\t\tadded.forEach((d) => {\n\t\t\tif (!this._dependants.has(d)) {\n\t\t\t\tthis._dependants.set(d, new Set<string>());\n\t\t\t}\n\t\t\tthis._dependants.get(d)!.add(compileData.filename);\n\t\t});\n\t\tremoved.forEach((d) => {\n\t\t\tthis._dependants.get(d)!.delete(compileData.filename);\n\t\t});\n\t}\n\n\tpublic remove(svelteRequest: SvelteRequest): boolean {\n\t\tconst id = svelteRequest.normalizedFilename;\n\t\tlet removed = false;\n\t\tif (this._js.delete(id)) {\n\t\t\tremoved = true;\n\t\t}\n\t\tif (this._css.delete(id)) {\n\t\t\tremoved = true;\n\t\t}\n\t\tconst dependencies = this._dependencies.get(id);\n\t\tif (dependencies) {\n\t\t\tremoved = true;\n\t\t\tdependencies.forEach((d) => {\n\t\t\t\tconst dependants = this._dependants.get(d);\n\t\t\t\tif (dependants && dependants.has(svelteRequest.filename)) {\n\t\t\t\t\tdependants.delete(svelteRequest.filename);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._dependencies.delete(id);\n\t\t}\n\t\treturn removed;\n\t}\n\n\tpublic getCSS(svelteRequest: SvelteRequest) {\n\t\treturn this._css.get(svelteRequest.normalizedFilename);\n\t}\n\n\tpublic getJS(svelteRequest: SvelteRequest) {\n\t\tif (!svelteRequest.ssr) {\n\t\t\t// SSR js isn't cached\n\t\t\treturn this._js.get(svelteRequest.normalizedFilename);\n\t\t}\n\t}\n\n\tpublic getDependants(path: string): string[] {\n\t\tconst dependants = this._dependants.get(path);\n\t\treturn dependants ? [...dependants] : [];\n\t}\n}\n", "import { VitePluginSvelteCache } from './vite-plugin-svelte-cache';\nimport fs from 'fs';\nimport { log } from './log';\nimport { IdParser } from './id';\nimport { ResolvedOptions } from './options';\nimport { knownSvelteConfigNames } from './load-svelte-config';\nimport path from 'path';\n\nexport function setupWatchers(\n\toptions: ResolvedOptions,\n\tcache: VitePluginSvelteCache,\n\trequestParser: IdParser\n) {\n\tconst { server, configFile: svelteConfigFile } = options;\n\tif (!server) {\n\t\treturn;\n\t}\n\tconst { watcher, ws } = server;\n\tconst { configFile: viteConfigFile, root, server: serverConfig } = server.config;\n\n\tconst emitChangeEventOnDependants = (filename: string) => {\n\t\tconst dependants = cache.getDependants(filename);\n\t\tdependants.forEach((dependant) => {\n\t\t\tif (fs.existsSync(dependant)) {\n\t\t\t\tlog.debug(\n\t\t\t\t\t`emitting virtual change event for \"${dependant}\" because depdendency \"${filename}\" changed`\n\t\t\t\t);\n\t\t\t\twatcher.emit('change', dependant);\n\t\t\t}\n\t\t});\n\t};\n\n\tconst removeUnlinkedFromCache = (filename: string) => {\n\t\tconst svelteRequest = requestParser(filename, false);\n\t\tif (svelteRequest) {\n\t\t\tconst removedFromCache = cache.remove(svelteRequest);\n\t\t\tif (removedFromCache) {\n\t\t\t\tlog.debug(`cleared VitePluginSvelteCache for deleted file ${filename}`);\n\t\t\t}\n\t\t}\n\t};\n\n\tconst triggerViteRestart = (filename: string) => {\n\t\t// vite restart is triggered by simulating a change to vite config. This requires that vite config exists\n\t\t// also we do not restart in middleware-mode as it could be risky\n\t\tif (!!viteConfigFile && !serverConfig.middlewareMode) {\n\t\t\tlog.info(`svelte config changed: restarting vite server. - file: ${filename}`);\n\t\t\twatcher.emit('change', viteConfigFile);\n\t\t} else {\n\t\t\tconst message =\n\t\t\t\t'Svelte config change detected, restart your dev process to apply the changes.';\n\t\t\tlog.info(message, filename);\n\t\t\tws.send({\n\t\t\t\ttype: 'error',\n\t\t\t\terr: { message, stack: '', plugin: 'vite-plugin-svelte', id: filename }\n\t\t\t});\n\t\t}\n\t};\n\n\tconst possibleSvelteConfigs = knownSvelteConfigNames.map((cfg) => path.join(root, cfg));\n\tconst restartOnConfigAdd = (filename: string) => {\n\t\tif (possibleSvelteConfigs.includes(filename)) {\n\t\t\ttriggerViteRestart(filename);\n\t\t}\n\t};\n\n\tconst restartOnConfigChange = (filename: string) => {\n\t\tif (filename === svelteConfigFile) {\n\t\t\ttriggerViteRestart(filename);\n\t\t}\n\t};\n\n\t// collection of watcher listeners by event\n\tconst listeners = {\n\t\tadd: [],\n\t\tchange: [emitChangeEventOnDependants],\n\t\tunlink: [removeUnlinkedFromCache, emitChangeEventOnDependants]\n\t};\n\tif (svelteConfigFile) {\n\t\tlisteners.change.push(restartOnConfigChange);\n\t\tlisteners.unlink.push(restartOnConfigChange);\n\t} else {\n\t\t// @ts-ignore\n\t\tlisteners.add.push(restartOnConfigAdd);\n\t}\n\n\tObject.entries(listeners).forEach(([evt, listeners]) => {\n\t\tif (listeners.length > 0) {\n\t\t\twatcher.on(evt, (filename) => listeners.forEach((listener) => listener(filename)));\n\t\t}\n\t});\n}\n", "import path from 'path';\nimport fs from 'fs';\n// @ts-ignore\nimport relative from 'require-relative';\n\nexport function resolveViaPackageJsonSvelte(importee: string, importer?: string): string | void {\n\tif (importer && isBareImport(importee)) {\n\t\tconst importeePkgFile = relative.resolve(`${importee}/package.json`, path.dirname(importer));\n\t\tconst importeePkg = JSON.parse(fs.readFileSync(importeePkgFile, { encoding: 'utf-8' }));\n\t\tif (importeePkg.svelte) {\n\t\t\treturn path.resolve(path.dirname(importeePkgFile), importeePkg.svelte);\n\t\t}\n\t}\n}\n\nfunction isBareImport(importee: string): boolean {\n\tif (!importee || importee[0] === '.' || importee[0] === '\\0' || path.isAbsolute(importee)) {\n\t\treturn false;\n\t}\n\tconst parts = importee.split('/');\n\tswitch (parts.length) {\n\t\tcase 1:\n\t\t\treturn true;\n\t\tcase 2:\n\t\t\treturn parts[0].startsWith('@');\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n", "import { ResolvedConfig, TransformResult, Plugin } from 'vite';\nimport MagicString from 'magic-string';\nimport { Preprocessor, PreprocessorGroup, Processed, ResolvedOptions } from './options';\nimport { TransformPluginContext } from 'rollup';\nimport { log } from './log';\nimport { buildSourceMap } from './sourcemap';\n\nconst supportedStyleLangs = ['css', 'less', 'sass', 'scss', 'styl', 'stylus', 'postcss'];\n\nconst supportedScriptLangs = ['ts'];\n\nfunction createPreprocessorFromVitePlugin(\n\tconfig: ResolvedConfig,\n\toptions: ResolvedOptions,\n\tpluginName: string,\n\tsupportedLangs: string[]\n): Preprocessor {\n\tconst plugin = config.plugins.find((p) => p.name === pluginName);\n\tif (!plugin) {\n\t\tthrow new Error(`failed to find plugin ${pluginName}`);\n\t}\n\tif (!plugin.transform) {\n\t\tthrow new Error(`plugin ${pluginName} has no transform`);\n\t}\n\tconst pluginTransform = plugin.transform!.bind(null as unknown as TransformPluginContext);\n\t// @ts-ignore\n\treturn async ({ attributes, content, filename }) => {\n\t\tconst lang = attributes.lang as string;\n\t\tif (!supportedLangs.includes(lang)) {\n\t\t\treturn { code: content };\n\t\t}\n\t\tconst moduleId = `${filename}.${lang}`;\n\t\tconst moduleGraph = options.server?.moduleGraph;\n\t\tif (moduleGraph && !moduleGraph.getModuleById(moduleId)) {\n\t\t\tawait moduleGraph.ensureEntryFromUrl(moduleId);\n\t\t}\n\t\tconst transformResult: TransformResult = (await pluginTransform(\n\t\t\tcontent,\n\t\t\tmoduleId\n\t\t)) as TransformResult;\n\t\t// TODO vite:css transform currently returns an empty mapping that would kill svelte compiler.\n\t\tconst hasMap = transformResult.map && transformResult.map?.mappings !== '';\n\t\tif (transformResult.map?.sources?.[0] === moduleId) {\n\t\t\ttransformResult.map.sources[0] = filename as string;\n\t\t}\n\t\treturn {\n\t\t\tcode: transformResult.code,\n\t\t\tmap: hasMap ? (transformResult.map as object) : undefined,\n\t\t\tdependencies: transformResult.deps\n\t\t};\n\t};\n}\n\nexport function createVitePreprocessorGroup(\n\tconfig: ResolvedConfig,\n\toptions: ResolvedOptions\n): PreprocessorGroup {\n\treturn {\n\t\tscript: createPreprocessorFromVitePlugin(config, options, 'vite:esbuild', supportedScriptLangs),\n\t\tstyle: createPreprocessorFromVitePlugin(config, options, 'vite:css', supportedStyleLangs)\n\t} as PreprocessorGroup;\n}\n\n/**\n * this appends a *{} rule to component styles to force the svelte compiler to add style classes to all nodes\n * That means adding/removing class rules from <style> node won't trigger js updates as the scope classes are not changed\n *\n * only used during dev with enabled css hmr\n */\nfunction createInjectScopeEverythingRulePreprocessorGroup(): PreprocessorGroup {\n\treturn {\n\t\tstyle({ content, filename }) {\n\t\t\tconst s = new MagicString(content);\n\t\t\ts.append(' *{}');\n\t\t\treturn {\n\t\t\t\tcode: s.toString(),\n\t\t\t\tmap: s.generateDecodedMap({ source: filename, hires: true })\n\t\t\t};\n\t\t}\n\t};\n}\n\nfunction buildExtraPreprocessors(options: ResolvedOptions, config: ResolvedConfig) {\n\tconst extraPreprocessors = [];\n\tif (options.experimental?.useVitePreprocess) {\n\t\tlog.debug('adding vite preprocessor');\n\t\textraPreprocessors.push(createVitePreprocessorGroup(config, options));\n\t}\n\n\t// @ts-ignore\n\tconst pluginsWithPreprocessorsDeprecated = config.plugins.filter((p) => p?.sveltePreprocess);\n\tif (pluginsWithPreprocessorsDeprecated.length > 0) {\n\t\tlog.warn(\n\t\t\t`The following plugins use the deprecated 'plugin.sveltePreprocess' field. Please contact their maintainers and ask them to move it to 'plugin.api.sveltePreprocess': ${pluginsWithPreprocessorsDeprecated\n\t\t\t\t.map((p) => p.name)\n\t\t\t\t.join(', ')}`\n\t\t);\n\t\t// patch plugin to avoid breaking\n\t\tpluginsWithPreprocessorsDeprecated.forEach((p) => {\n\t\t\tif (!p.api) {\n\t\t\t\tp.api = {};\n\t\t\t}\n\t\t\tif (p.api.sveltePreprocess === undefined) {\n\t\t\t\t// @ts-ignore\n\t\t\t\tp.api.sveltePreprocess = p.sveltePreprocess;\n\t\t\t} else {\n\t\t\t\tlog.error(\n\t\t\t\t\t`ignoring plugin.sveltePreprocess of ${p.name} because it already defined plugin.api.sveltePreprocess.`\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t}\n\n\tconst pluginsWithPreprocessors: Plugin[] = config.plugins.filter((p) => p?.api?.sveltePreprocess);\n\tconst ignored: Plugin[] = [],\n\t\tincluded: Plugin[] = [];\n\tfor (const p of pluginsWithPreprocessors) {\n\t\tif (\n\t\t\toptions.ignorePluginPreprocessors === true ||\n\t\t\t(Array.isArray(options.ignorePluginPreprocessors) &&\n\t\t\t\toptions.ignorePluginPreprocessors?.includes(p.name))\n\t\t) {\n\t\t\tignored.push(p);\n\t\t} else {\n\t\t\tincluded.push(p);\n\t\t}\n\t}\n\tif (ignored.length > 0) {\n\t\tlog.debug(\n\t\t\t`Ignoring svelte preprocessors defined by these vite plugins: ${ignored\n\t\t\t\t.map((p) => p.name)\n\t\t\t\t.join(', ')}`\n\t\t);\n\t}\n\tif (included.length > 0) {\n\t\tlog.debug(\n\t\t\t`Adding svelte preprocessors defined by these vite plugins: ${included\n\t\t\t\t.map((p) => p.name)\n\t\t\t\t.join(', ')}`\n\t\t);\n\t\textraPreprocessors.push(...pluginsWithPreprocessors.map((p) => p.api.sveltePreprocess));\n\t}\n\n\tif (options.hot && options.emitCss) {\n\t\textraPreprocessors.push(createInjectScopeEverythingRulePreprocessorGroup());\n\t}\n\n\treturn extraPreprocessors;\n}\n\nexport function addExtraPreprocessors(options: ResolvedOptions, config: ResolvedConfig) {\n\tconst extra = buildExtraPreprocessors(options, config);\n\tif (extra?.length > 0) {\n\t\tif (!options.preprocess) {\n\t\t\toptions.preprocess = extra;\n\t\t} else if (Array.isArray(options.preprocess)) {\n\t\t\toptions.preprocess.push(...extra);\n\t\t} else {\n\t\t\toptions.preprocess = [options.preprocess, ...extra];\n\t\t}\n\t}\n\tconst generateMissingSourceMaps = !!options.experimental?.generateMissingPreprocessorSourcemaps;\n\tif (options.preprocess && generateMissingSourceMaps) {\n\t\toptions.preprocess = Array.isArray(options.preprocess)\n\t\t\t? options.preprocess.map((p, i) => validateSourceMapOutputWrapper(p, i))\n\t\t\t: validateSourceMapOutputWrapper(options.preprocess, 0);\n\t}\n}\n\nfunction validateSourceMapOutputWrapper(group: PreprocessorGroup, i: number): PreprocessorGroup {\n\tconst wrapper: PreprocessorGroup = {};\n\n\tfor (const [processorType, processorFn] of Object.entries(group) as Array<\n\t\t// eslint-disable-next-line no-unused-vars\n\t\t[keyof PreprocessorGroup, (options: { filename?: string; content: string }) => Processed]\n\t>) {\n\t\twrapper[processorType] = async (options) => {\n\t\t\tconst result = await processorFn(options);\n\n\t\t\tif (result && result.code !== options.content) {\n\t\t\t\tlet invalidMap = false;\n\t\t\t\tif (!result.map) {\n\t\t\t\t\tinvalidMap = true;\n\t\t\t\t\tlog.warn.enabled &&\n\t\t\t\t\t\tlog.warn.once(\n\t\t\t\t\t\t\t`preprocessor at index ${i} did not return a sourcemap for ${processorType} transform`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfilename: options.filename,\n\t\t\t\t\t\t\t\ttype: processorType,\n\t\t\t\t\t\t\t\tprocessor: processorFn.toString()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t} else if ((result.map as any)?.mappings === '') {\n\t\t\t\t\tinvalidMap = true;\n\t\t\t\t\tlog.warn.enabled &&\n\t\t\t\t\t\tlog.warn.once(\n\t\t\t\t\t\t\t`preprocessor at index ${i} returned an invalid empty sourcemap for ${processorType} transform`,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfilename: options.filename,\n\t\t\t\t\t\t\t\ttype: processorType,\n\t\t\t\t\t\t\t\tprocessor: processorFn.toString()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (invalidMap) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst map = await buildSourceMap(options.content, result.code, options.filename);\n\t\t\t\t\t\tif (map) {\n\t\t\t\t\t\t\tlog.debug.enabled &&\n\t\t\t\t\t\t\t\tlog.debug(\n\t\t\t\t\t\t\t\t\t`adding generated sourcemap to preprocesor result for ${options.filename}`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tresult.map = map;\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tlog.error(`failed to build sourcemap`, e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t}\n\n\treturn wrapper;\n}\n", "import MagicString, { MagicStringOptions } from 'magic-string';\nimport { log } from './log';\n\nexport async function buildMagicString(\n\tfrom: string,\n\tto: string,\n\toptions?: MagicStringOptions\n): Promise<MagicString | null> {\n\tlet diff_match_patch, DIFF_DELETE: number, DIFF_INSERT: number;\n\ttry {\n\t\tconst dmpPkg = await import('diff-match-patch');\n\t\tdiff_match_patch = dmpPkg.diff_match_patch;\n\t\tDIFF_INSERT = dmpPkg.DIFF_INSERT;\n\t\tDIFF_DELETE = dmpPkg.DIFF_DELETE;\n\t} catch (e) {\n\t\tlog.error.once(\n\t\t\t'Failed to import optional dependency \"diff-match-patch\". Please install it to enable generated sourcemaps.'\n\t\t);\n\t\treturn null;\n\t}\n\n\tconst dmp = new diff_match_patch();\n\tconst diffs = dmp.diff_main(from, to);\n\tdmp.diff_cleanupSemantic(diffs);\n\tconst m = new MagicString(from, options);\n\tlet pos = 0;\n\tfor (let i = 0; i < diffs.length; i++) {\n\t\tconst diff = diffs[i];\n\t\tconst nextDiff = diffs[i + 1];\n\t\tif (diff[0] === DIFF_DELETE) {\n\t\t\tif (nextDiff?.[0] === DIFF_INSERT) {\n\t\t\t\t// delete followed by insert, use overwrite and skip ahead\n\t\t\t\tm.overwrite(pos, pos + diff[1].length, nextDiff[1]);\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tm.remove(pos, pos + diff[1].length);\n\t\t\t}\n\t\t\tpos += diff[1].length;\n\t\t} else if (diff[0] === DIFF_INSERT) {\n\t\t\tif (nextDiff) {\n\t\t\t\tm.appendRight(pos, diff[1]);\n\t\t\t} else {\n\t\t\t\tm.append(diff[1]);\n\t\t\t}\n\t\t} else {\n\t\t\t// unchanged block, advance pos\n\t\t\tpos += diff[1].length;\n\t\t}\n\t}\n\t// at this point m.toString() === to\n\treturn m;\n}\n\nexport async function buildSourceMap(from: string, to: string, filename?: string) {\n\t// @ts-ignore\n\tconst m = await buildMagicString(from, to, { filename });\n\treturn m ? m.generateDecodedMap({ source: filename, hires: true, includeContent: false }) : null;\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,iBAAe;;;ACCf,oBAAkC;AAClC,mBAAkB;AAGlB,IAAM,SAAmB,CAAC,SAAS,QAAQ,QAAQ,SAAS;AAC5D,IAAM,SAAS;AACf,IAAM,UAAkC;AAAA,EACvC,OAAO;AAAA,IACN,KAAK,0BAAM,Q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