Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Preserve "[" and "]" in bundle of rollupOptions #19030

Closed
7 tasks done
rtritto opened this issue Dec 20, 2024 · 1 comment
Closed
7 tasks done

Preserve "[" and "]" in bundle of rollupOptions #19030

rtritto opened this issue Dec 20, 2024 · 1 comment

Comments

@rtritto
Copy link

rtritto commented Dec 20, 2024

Describe the bug

Having the API routes in ./server/api directory and it needs to be bundled in ./dist/server/api.

Example

Source file ./server/api/user/[id]/(post).ts as the API route file.

Expected

./dist/server/api/user/[id]/(post).mjs

Current

./dist/server/api/user/_id_/(post).mjs

Reproduction

https://github.com/rtritto/vite-preserve

Steps to reproduce

  • git clone https://github.com/rtritto/vite-preserve.git
  • cd vite-preserve
  • yarn
  • yarn build or yarn vite build

System Info

System:
    OS: Windows 11 10.0.22631
  Binaries:
    Node: 22.9.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 4.5.3 - C:\Program Files\nodejs\yarn.CMD
    npm: 10.8.3 - C:\Program Files\nodejs\npm.CMD

Used Package Manager

yarn

Logs

Logs
The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
  vite:config bundled config file loaded in 62.49ms +0ms
  vite:config using resolved config: {
  vite:config   cacheDir: 'C:/vite-preserve/.vite',
  vite:config   plugins: [
  vite:config     'vite:build-metadata',
  vite:config     'vite:watch-package-data',
  vite:config     'vite:pre-alias',
  vite:config     'alias',
  vite:config     'vite:modulepreload-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html-inline-proxy',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm-helper',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:wasm-fallback',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:build-html',
  vite:config     'vite:worker-import-meta-url',
  vite:config     'vite:asset-import-meta-url',
  vite:config     'vite:force-systemjs-wrap-complete',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'vite:rollup-options-plugins',
  vite:config     'vite:dynamic-import-vars',
  vite:config     'vite:import-glob',
  vite:config     'vite-plugin-bundle-files',
  vite:config     'vite:build-import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:manifest',
  vite:config     'vite:ssr-manifest',
  vite:config     'vite:reporter',
  vite:config     'vite:load-fallback'
  vite:config   ],
  vite:config   build: {
  vite:config     target: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],     
  vite:config     polyfillModulePreload: true,
  vite:config     modulePreload: { polyfill: true },
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     sourcemap: false,
  vite:config     terserOptions: {},
  vite:config     rollupOptions: {},
  vite:config     commonjsOptions: { include: [ /node_modules/ ], extensions: [ '.js', '.cjs' ] },
  vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [ /node_modules/ ] },
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     copyPublicDir: true,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssrManifest: false,
  vite:config     ssrEmitAssets: false,
  vite:config     reportCompressedSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null,
  vite:config     cssCodeSplit: true,
  vite:config     minify: 'esbuild',
  vite:config     ssr: false,
  vite:config     emitAssets: true,
  vite:config     createEnvironment: [Function: createEnvironment],
  vite:config     cssTarget: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],  
  vite:config     cssMinify: true
  vite:config   },
  vite:config   environments: {
  vite:config     client: {
  vite:config       define: undefined,
  vite:config       resolve: {
  vite:config         externalConditions: [ 'node' ],
  vite:config         extensions: [ '.mjs', '.js', '.ts', '.jsx', '.tsx', '.json' ],       
  vite:config         dedupe: [],
  vite:config         noExternal: [],
  vite:config         external: [],
  vite:config         preserveSymlinks: false,
  vite:config         alias: [
  vite:config           {
  vite:config             find: /^\/?@vite\/env/,
  vite:config             replacement: '/@fs/C:/vite-preserve/.yarn/__virtual__/vite-virtual-dbc7c14500/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vite-npm-6.0.5-7387b23353-10c0.zip/node_modules/vite/dist/client/env.mjs'
  vite:config           },
  vite:config           {
  vite:config             find: /^\/?@vite\/client/,
  vite:config             replacement: '/@fs/C:/vite-preserve/.yarn/__virtual__/vite-virtual-dbc7c14500/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vite-npm-6.0.5-7387b23353-10c0.zip/node_modules/vite/dist/client/client.mjs'
  vite:config           }
  vite:config         ],
  vite:config         mainFields: [ 'browser', 'module', 'jsnext:main', 'jsnext' ],        
  vite:config         conditions: [ 'module', 'browser', 'development|production' ],       
  vite:config         enableBuiltinNoExternalCheck: false
  vite:config       },
  vite:config       keepProcessEnv: false,
  vite:config       consumer: 'client',
  vite:config       optimizeDeps: {
  vite:config         include: [],
  vite:config         exclude: [],
  vite:config         needsInterop: [],
  vite:config         extensions: [],
  vite:config         disabled: undefined,
  vite:config         holdUntilCrawlEnd: true,
  vite:config         force: false,
  vite:config         noDiscovery: false,
  vite:config         esbuildOptions: { preserveSymlinks: false }
  vite:config       },
  vite:config       dev: {
  vite:config         warmup: [],
  vite:config         sourcemap: { js: true },
  vite:config         sourcemapIgnoreList: [Function: isInNodeModules$1],
  vite:config         preTransformRequests: true,
  vite:config         createEnvironment: [Function: defaultCreateClientDevEnvironment],    
  vite:config         recoverable: true,
  vite:config         moduleRunnerTransform: false
  vite:config       },
  vite:config       build: {
  vite:config         target: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ], 
  vite:config         polyfillModulePreload: true,
  vite:config         modulePreload: { polyfill: true },
  vite:config         outDir: 'dist',
  vite:config         assetsDir: 'assets',
  vite:config         assetsInlineLimit: 4096,
  vite:config         sourcemap: false,
  vite:config         terserOptions: {},
  vite:config         rollupOptions: {},
  vite:config         commonjsOptions: { include: [ /node_modules/ ], extensions: [ '.js', '.cjs' ] },
  vite:config         dynamicImportVarsOptions: { warnOnError: true, exclude: [ /node_modules/ ] },
  vite:config         write: true,
  vite:config         emptyOutDir: null,
  vite:config         copyPublicDir: true,
  vite:config         manifest: false,
  vite:config         lib: false,
  vite:config         ssrManifest: false,
  vite:config         ssrEmitAssets: false,
  vite:config         reportCompressedSize: true,
  vite:config         chunkSizeWarningLimit: 500,
  vite:config         watch: null,
  vite:config         cssCodeSplit: true,
  vite:config         minify: 'esbuild',
  vite:config         ssr: false,
  vite:config         emitAssets: true,
  vite:config         createEnvironment: [Function: createEnvironment],
  vite:config         cssTarget: [ 'es2020', 'edge88', 'firefox78', 'chrome87', 'safari14' ],
  vite:config         cssMinify: true
  vite:config       }
  vite:config     }
  vite:config   },
  vite:config   resolve: {
  vite:config     externalConditions: [ 'node' ],
  vite:config     extensions: [ '.mjs', '.js', '.ts', '.jsx', '.tsx', '.json' ],
  vite:config     dedupe: [],
  vite:config     noExternal: [],
  vite:config     external: [],
  vite:config     preserveSymlinks: false,
  vite:config     alias: [
  vite:config       {
  vite:config         find: /^\/?@vite\/env/,
  vite:config         replacement: '/@fs/C:/vite-preserve/.yarn/__virtual__/vite-virtual-dbc7c14500/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vite-npm-6.0.5-7387b23353-10c0.zip/node_modules/vite/dist/client/env.mjs'
  vite:config       },
  vite:config       {
  vite:config         find: /^\/?@vite\/client/,
  vite:config         replacement: '/@fs/C:/vite-preserve/.yarn/__virtual__/vite-virtual-dbc7c14500/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vite-npm-6.0.5-7387b23353-10c0.zip/node_modules/vite/dist/client/client.mjs'
  vite:config       }
  vite:config     ],
  vite:config     mainFields: [ 'module', 'jsnext:main', 'jsnext' ],
  vite:config     conditions: [ 'module', 'node', 'development|production' ],
  vite:config     enableBuiltinNoExternalCheck: false
  vite:config   },
  vite:config   configFile: 'C:/vite-preserve/vite.config.ts',   
  vite:config   configFileDependencies: [
  vite:config     'C:/vite-preserve/vitePluginApi.ts',
  vite:config     'C:/vite-preserve/vite.config.ts'
  vite:config   ],
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     build: {}
  vite:config   },
  vite:config   root: 'C:/vite-preserve',
  vite:config   base: '/',
  vite:config   decodedBase: '/',
  vite:config   rawBase: '/',
  vite:config   publicDir: 'C:/vite-preserve/public',
  vite:config   command: 'build',
  vite:config   mode: 'production',
  vite:config   isWorker: false,
  vite:config   mainConfig: null,
  vite:config   bundleChain: [],
  vite:config   isProduction: true,
  vite:config   css: {
  vite:config     transformer: 'postcss',
  vite:config     preprocessorMaxWorkers: 0,
  vite:config     devSourcemap: false,
  vite:config     lightningcss: undefined
  vite:config   },
  vite:config   json: { namedExports: true, stringify: 'auto' },
  vite:config   esbuild: { jsxDev: false },
  vite:config   server: {
  vite:config     port: 5173,
  vite:config     strictPort: false,
  vite:config     host: undefined,
  vite:config     https: undefined,
  vite:config     open: false,
  vite:config     proxy: undefined,
  vite:config     cors: true,
  vite:config     headers: {},
  vite:config     warmup: { clientFiles: [], ssrFiles: [] },
  vite:config     middlewareMode: false,
  vite:config     fs: {
  vite:config       strict: true,
  vite:config       deny: [ '.env', '.env.*', '*.{crt,pem}', '**/.git/**' ],
  vite:config       allow: [
  vite:config         'C:/vite-preserve',
  vite:config         'C:/Users/<USER>/AppData/Local/Yarn/Berry'
  vite:config       ]
  vite:config     },
  vite:config     preTransformRequests: true,
  vite:config     perEnvironmentStartEndDuringDev: false,
  vite:config     sourcemapIgnoreList: [Function: isInNodeModules$1]
  vite:config   },
  vite:config   builder: undefined,
  vite:config   preview: {
  vite:config     port: 4173,
  vite:config     strictPort: false,
  vite:config     host: undefined,
  vite:config     https: undefined,
  vite:config     open: false,
  vite:config     proxy: undefined,
  vite:config     cors: true,
  vite:config     headers: {}
  vite:config   },
  vite:config   envDir: 'C:/vite-preserve',
  vite:config   env: { BASE_URL: '/', MODE: 'production', DEV: false, PROD: true },        
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     warnOnce: [Function: warnOnce],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen],
  vite:config     hasErrorLogged: [Function: hasErrorLogged]
  vite:config   },
  vite:config   packageCache: Map(1) {
  vite:config     'fnpd_C:/vite-preserve' => {
  vite:config       dir: 'C:/vite-preserve',
  vite:config       data: {
  vite:config         name: 'vite-preserve',
  vite:config         version: '1.0.0',
  vite:config         main: 'index.js',
  vite:config         license: 'MIT',
  vite:config         packageManager: '[email protected]',
  vite:config         scripts: { dev: 'vite', build: 'vite build', serve: 'vite preview' },
  vite:config         devDependencies: {
  vite:config           '@types/node': '^22.10.2',
  vite:config           '@yarnpkg/sdks': '^3.2.0',
  vite:config           typescript: '^5.7.2',
  vite:config           vite: '^6.0.5'
  vite:config         }
  vite:config       },
  vite:config       hasSideEffects: [Function: hasSideEffects],
  vite:config       setResolvedCache: [Function: setResolvedCache],
  vite:config       getResolvedCache: [Function: getResolvedCache]
  vite:config     },
  vite:config     set: [Function (anonymous)]
  vite:config   },
  vite:config   worker: { format: 'iife', plugins: '() => plugins', rollupOptions: {} },   
  vite:config   appType: 'spa',
  vite:config   experimental: { importGlobRestoreExtension: false, hmrPartialAccept: false },
  vite:config   future: undefined,
  vite:config   ssr: {
  vite:config     target: 'node',
  vite:config     optimizeDeps: { esbuildOptions: { preserveSymlinks: false } },
  vite:config     resolve: { conditions: undefined, externalConditions: undefined }        
  vite:config   },
  vite:config   optimizeDeps: {
  vite:config     include: [],
  vite:config     exclude: [],
  vite:config     needsInterop: [],
  vite:config     extensions: [],
  vite:config     disabled: undefined,
  vite:config     holdUntilCrawlEnd: true,
  vite:config     force: false,
  vite:config     noDiscovery: false,
  vite:config     esbuildOptions: { preserveSymlinks: false }
  vite:config   },
  vite:config   dev: {
  vite:config     warmup: [],
  vite:config     sourcemap: { js: true },
  vite:config     sourcemapIgnoreList: [Function: isInNodeModules$1],
  vite:config     preTransformRequests: false,
  vite:config     createEnvironment: [Function: defaultCreateDevEnvironment],
  vite:config     recoverable: false,
  vite:config     moduleRunnerTransform: false
  vite:config   },
  vite:config   getSortedPlugins: [Function: getSortedPlugins],
  vite:config   getSortedPluginHooks: [Function: getSortedPluginHooks],
  vite:config   createResolver: [Function: createResolver],
  vite:config   fsDenyGlob: [Function: arrayMatcher],
  vite:config   safeModulePaths: Set(0) {}
  vite:config } +537ms
vite v6.0.5 building for production...
entryFilepathFull:  {
  'user/[id]/(post)': 'C:/vite-preserve/server/api/user/[id]/(post).ts'
}
(node:35096) ExperimentalWarning: globSync is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
  vite:config using resolved config: {
  vite:config   configFile: undefined,
  vite:config   build: {
  vite:config     target: 'esnext',
  vite:config     polyfillModulePreload: true,
  vite:config     modulePreload: { polyfill: true },
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     sourcemap: false,
  vite:config     terserOptions: {},
  vite:config     rollupOptions: {
  vite:config       input: {
  vite:config         'user/[id]/(post)': 'C:/vite-preserve/server/api/user/[id]/(post).ts'
  vite:config       },
  vite:config       output: {
  vite:config         dir: 'C:\\vite-preserve\\dist\\server\\api',
  vite:config         format: 'esm',
  vite:config         entryFileNames: '[name].mjs'
  vite:config       }
  vite:config     },
  vite:config     commonjsOptions: { include: [ /node_modules/ ], extensions: [ '.js', '.cjs' ] },
  vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [ /node_modules/ ] },
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     copyPublicDir: true,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssrManifest: false,
  vite:config     ssrEmitAssets: false,
  vite:config     reportCompressedSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null,
  vite:config     cssCodeSplit: true,
  vite:config     minify: false,
  vite:config     ssr: true,
  vite:config     emitAssets: false,
  vite:config     createEnvironment: [Function: createEnvironment],
  vite:config     cssTarget: 'esnext',
  vite:config     cssMinify: 'esbuild'
  vite:config   },
  vite:config   environments: {
  vite:config     client: {
  vite:config       define: undefined,
  vite:config       resolve: {
  vite:config         externalConditions: [ 'node' ],
  vite:config         extensions: [ '.mjs', '.js', '.ts', '.jsx', '.tsx', '.json' ],       
  vite:config         dedupe: [],
  vite:config         noExternal: [],
  vite:config         external: [],
  vite:config         preserveSymlinks: false,
  vite:config         alias: [
  vite:config           {
  vite:config             find: /^\/?@vite\/env/,
  vite:config             replacement: '/@fs/C:/vite-preserve/.yarn/__virtual__/vite-virtual-dbc7c14500/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vite-npm-6.0.5-7387b23353-10c0.zip/node_modules/vite/dist/client/env.mjs'
  vite:config           },
  vite:config           {
  vite:config             find: /^\/?@vite\/client/,
  vite:config             replacement: '/@fs/C:/vite-preserve/.yarn/__virtual__/vite-virtual-dbc7c14500/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vite-npm-6.0.5-7387b23353-10c0.zip/node_modules/vite/dist/client/client.mjs'
  vite:config           }
  vite:config         ],
  vite:config         mainFields: [ 'browser', 'module', 'jsnext:main', 'jsnext' ],        
  vite:config         conditions: [ 'module', 'browser', 'development|production' ],       
  vite:config         enableBuiltinNoExternalCheck: false
  vite:config       },
  vite:config       keepProcessEnv: false,
  vite:config       consumer: 'client',
  vite:config       optimizeDeps: {
  vite:config         include: [],
  vite:config         exclude: [],
  vite:config         needsInterop: [],
  vite:config         extensions: [],
  vite:config         disabled: undefined,
  vite:config         holdUntilCrawlEnd: true,
  vite:config         force: false,
  vite:config         noDiscovery: false,
  vite:config         esbuildOptions: { preserveSymlinks: false }
  vite:config       },
  vite:config       dev: {
  vite:config         warmup: [],
  vite:config         sourcemap: { js: true },
  vite:config         sourcemapIgnoreList: [Function: isInNodeModules$1],
  vite:config         preTransformRequests: true,
  vite:config         createEnvironment: [Function: defaultCreateClientDevEnvironment],    
  vite:config         recoverable: true,
  vite:config         moduleRunnerTransform: false
  vite:config       },
  vite:config       build: {
  vite:config         target: 'esnext',
  vite:config         polyfillModulePreload: true,
  vite:config         modulePreload: { polyfill: true },
  vite:config         outDir: 'dist',
  vite:config         assetsDir: 'assets',
  vite:config         assetsInlineLimit: 4096,
  vite:config         sourcemap: false,
  vite:config         terserOptions: {},
  vite:config         rollupOptions: {
  vite:config           input: {
  vite:config             'user/[id]/(post)': 'C:/vite-preserve/server/api/user/[id]/(post).ts'
  vite:config           },
  vite:config           output: {
  vite:config             dir: 'C:\\vite-preserve\\dist\\server\\api',
  vite:config             format: 'esm',
  vite:config             entryFileNames: '[name].mjs'
  vite:config           }
  vite:config         },
  vite:config         commonjsOptions: { include: [ /node_modules/ ], extensions: [ '.js', '.cjs' ] },
  vite:config         dynamicImportVarsOptions: { warnOnError: true, exclude: [ /node_modules/ ] },
  vite:config         write: true,
  vite:config         emptyOutDir: null,
  vite:config         copyPublicDir: true,
  vite:config         manifest: false,
  vite:config         lib: false,
  vite:config         ssrManifest: false,
  vite:config         ssrEmitAssets: false,
  vite:config         reportCompressedSize: true,
  vite:config         chunkSizeWarningLimit: 500,
  vite:config         watch: null,
  vite:config         cssCodeSplit: true,
  vite:config         minify: 'esbuild',
  vite:config         ssr: true,
  vite:config         emitAssets: true,
  vite:config         createEnvironment: [Function: createEnvironment],
  vite:config         cssTarget: 'esnext',
  vite:config         cssMinify: true
  vite:config       }
  vite:config     },
  vite:config     ssr: {
  vite:config       define: undefined,
  vite:config       resolve: {
  vite:config         externalConditions: [ 'node' ],
  vite:config         extensions: [ '.mjs', '.js', '.ts', '.jsx', '.tsx', '.json' ],       
  vite:config         dedupe: [],
  vite:config         noExternal: [],
  vite:config         external: [],
  vite:config         preserveSymlinks: false,
  vite:config         alias: [
  vite:config           {
  vite:config             find: /^\/?@vite\/env/,
  vite:config             replacement: '/@fs/C:/vite-preserve/.yarn/__virtual__/vite-virtual-dbc7c14500/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vite-npm-6.0.5-7387b23353-10c0.zip/node_modules/vite/dist/client/env.mjs'
  vite:config           },
  vite:config           {
  vite:config             find: /^\/?@vite\/client/,
  vite:config             replacement: '/@fs/C:/vite-preserve/.yarn/__virtual__/vite-virtual-dbc7c14500/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vite-npm-6.0.5-7387b23353-10c0.zip/node_modules/vite/dist/client/client.mjs'
  vite:config           }
  vite:config         ],
  vite:config         mainFields: [ 'module', 'jsnext:main', 'jsnext' ],
  vite:config         conditions: [ 'module', 'node', 'development|production' ],
  vite:config         enableBuiltinNoExternalCheck: false
  vite:config       },
  vite:config       keepProcessEnv: true,
  vite:config       consumer: 'server',
  vite:config       optimizeDeps: {
  vite:config         include: [],
  vite:config         exclude: [],
  vite:config         needsInterop: [],
  vite:config         extensions: [],
  vite:config         disabled: undefined,
  vite:config         holdUntilCrawlEnd: true,
  vite:config         force: false,
  vite:config         noDiscovery: true,
  vite:config         esbuildOptions: { preserveSymlinks: false }
  vite:config       },
  vite:config       dev: {
  vite:config         warmup: [],
  vite:config         sourcemap: { js: true },
  vite:config         sourcemapIgnoreList: [Function: isInNodeModules$1],
  vite:config         preTransformRequests: false,
  vite:config         createEnvironment: [Function: defaultCreateDevEnvironment],
  vite:config         recoverable: false,
  vite:config         moduleRunnerTransform: true
  vite:config       },
  vite:config       build: {
  vite:config         target: 'esnext',
  vite:config         polyfillModulePreload: true,
  vite:config         modulePreload: { polyfill: true },
  vite:config         outDir: 'dist',
  vite:config         assetsDir: 'assets',
  vite:config         assetsInlineLimit: 4096,
  vite:config         sourcemap: false,
  vite:config         terserOptions: {},
  vite:config         rollupOptions: {
  vite:config           input: {
  vite:config             'user/[id]/(post)': 'C:/vite-preserve/server/api/user/[id]/(post).ts'
  vite:config           },
  vite:config           output: {
  vite:config             dir: 'C:\\vite-preserve\\dist\\server\\api',
  vite:config             format: 'esm',
  vite:config             entryFileNames: '[name].mjs'
  vite:config           }
  vite:config         },
  vite:config         commonjsOptions: { include: [ /node_modules/ ], extensions: [ '.js', '.cjs' ] },
  vite:config         dynamicImportVarsOptions: { warnOnError: true, exclude: [ /node_modules/ ] },
  vite:config         write: true,
  vite:config         emptyOutDir: null,
  vite:config         copyPublicDir: true,
  vite:config         manifest: false,
  vite:config         lib: false,
  vite:config         ssrManifest: false,
  vite:config         ssrEmitAssets: false,
  vite:config         reportCompressedSize: true,
  vite:config         chunkSizeWarningLimit: 500,
  vite:config         watch: null,
  vite:config         cssCodeSplit: true,
  vite:config         minify: false,
  vite:config         ssr: true,
  vite:config         emitAssets: false,
  vite:config         createEnvironment: [Function: createEnvironment],
  vite:config         cssTarget: 'esnext',
  vite:config         cssMinify: 'esbuild'
  vite:config       }
  vite:config     }
  vite:config   },
  vite:config   resolve: {
  vite:config     externalConditions: [ 'node' ],
  vite:config     extensions: [ '.mjs', '.js', '.ts', '.jsx', '.tsx', '.json' ],
  vite:config     dedupe: [],
  vite:config     noExternal: [],
  vite:config     external: [],
  vite:config     preserveSymlinks: false,
  vite:config     alias: [
  vite:config       {
  vite:config         find: /^\/?@vite\/env/,
  vite:config         replacement: '/@fs/C:/vite-preserve/.yarn/__virtual__/vite-virtual-dbc7c14500/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vite-npm-6.0.5-7387b23353-10c0.zip/node_modules/vite/dist/client/env.mjs'
  vite:config       },
  vite:config       {
  vite:config         find: /^\/?@vite\/client/,
  vite:config         replacement: '/@fs/C:/vite-preserve/.yarn/__virtual__/vite-virtual-dbc7c14500/4/Users/<USER>/AppData/Local/Yarn/Berry/cache/vite-npm-6.0.5-7387b23353-10c0.zip/node_modules/vite/dist/client/client.mjs'
  vite:config       }
  vite:config     ],
  vite:config     mainFields: [ 'module', 'jsnext:main', 'jsnext' ],
  vite:config     conditions: [ 'module', 'node', 'development|production' ],
  vite:config     enableBuiltinNoExternalCheck: false
  vite:config   },
  vite:config   configFileDependencies: [],
  vite:config   inlineConfig: {
  vite:config     configFile: false,
  vite:config     build: {
  vite:config       ssr: true,
  vite:config       target: 'esnext',
  vite:config       rollupOptions: {
  vite:config         input: {
  vite:config           'user/[id]/(post)': 'C:/vite-preserve/server/api/user/[id]/(post).ts'
  vite:config         },
  vite:config         output: {
  vite:config           dir: 'C:\\vite-preserve\\dist\\server\\api',
  vite:config           format: 'esm',
  vite:config           entryFileNames: '[name].mjs'
  vite:config         }
  vite:config       }
  vite:config     },
  vite:config     environments: {
  vite:config       client: {
  vite:config         define: undefined,
  vite:config         resolve: undefined,
  vite:config         dev: {},
  vite:config         build: {
  vite:config           ssr: true,
  vite:config           target: 'esnext',
  vite:config           rollupOptions: {
  vite:config             input: {
  vite:config               'user/[id]/(post)': 'C:/vite-preserve/server/api/user/[id]/(post).ts'
  vite:config             },
  vite:config             output: {
  vite:config               dir: 'C:\\vite-preserve\\dist\\server\\api',
  vite:config               format: 'esm',
  vite:config               entryFileNames: '[name].mjs'
  vite:config             }
  vite:config           }
  vite:config         },
  vite:config         optimizeDeps: undefined
  vite:config       },
  vite:config       ssr: {
  vite:config         define: undefined,
  vite:config         resolve: { mainFields: undefined, conditions: undefined },
  vite:config         dev: { createEnvironment: undefined, warmup: undefined },
  vite:config         build: {
  vite:config           ssr: true,
  vite:config           target: 'esnext',
  vite:config           rollupOptions: {
  vite:config             input: {
  vite:config               'user/[id]/(post)': 'C:/vite-preserve/server/api/user/[id]/(post).ts'
  vite:config             },
  vite:config             output: {
  vite:config               dir: 'C:\\vite-preserve\\dist\\server\\api',
  vite:config               format: 'esm',
  vite:config               entryFileNames: '[name].mjs'
  vite:config             }
  vite:config           },
  vite:config           createEnvironment: undefined
  vite:config         },
  vite:config         optimizeDeps: {}
  vite:config       }
  vite:config     },
  vite:config     resolve: { conditions: undefined, mainFields: undefined }
  vite:config   },
  vite:config   root: 'C:/vite-preserve',
  vite:config   base: '/',
  vite:config   decodedBase: '/',
  vite:config   rawBase: '/',
  vite:config   publicDir: 'C:/vite-preserve/public',
  vite:config   cacheDir: 'C:/vite-preserve/node_modules/.vite', 
  vite:config   command: 'build',
  vite:config   mode: 'production',
  vite:config   isWorker: false,
  vite:config   mainConfig: null,
  vite:config   bundleChain: [],
  vite:config   isProduction: true,
  vite:config   plugins: [
  vite:config     'vite:build-metadata',
  vite:config     'vite:watch-package-data',
  vite:config     'vite:pre-alias',
  vite:config     'alias',
  vite:config     'vite:modulepreload-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html-inline-proxy',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm-helper',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:wasm-fallback',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:build-html',
  vite:config     'vite:worker-import-meta-url',
  vite:config     'vite:asset-import-meta-url',
  vite:config     'vite:force-systemjs-wrap-complete',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'vite:rollup-options-plugins',
  vite:config     'vite:dynamic-import-vars',
  vite:config     'vite:import-glob',
  vite:config     'vite:build-import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:manifest',
  vite:config     'vite:ssr-manifest',
  vite:config     'vite:reporter',
  vite:config     'vite:load-fallback'
  vite:config   ],
  vite:config   css: {
  vite:config     transformer: 'postcss',
  vite:config     preprocessorMaxWorkers: 0,
  vite:config     devSourcemap: false,
  vite:config     lightningcss: undefined
  vite:config   },
  vite:config   json: { namedExports: true, stringify: 'auto' },
  vite:config   esbuild: { jsxDev: false },
  vite:config   server: {
  vite:config     port: 5173,
  vite:config     strictPort: false,
  vite:config     host: undefined,
  vite:config     https: undefined,
  vite:config     open: false,
  vite:config     proxy: undefined,
  vite:config     cors: true,
  vite:config     headers: {},
  vite:config     warmup: { clientFiles: [], ssrFiles: [] },
  vite:config     middlewareMode: false,
  vite:config     fs: {
  vite:config       strict: true,
  vite:config       deny: [ '.env', '.env.*', '*.{crt,pem}', '**/.git/**' ],
  vite:config       allow: [
  vite:config         'C:/vite-preserve',
  vite:config         'C:/Users/<USER>/AppData/Local/Yarn/Berry'
  vite:config       ]
  vite:config     },
  vite:config     preTransformRequests: true,
  vite:config     perEnvironmentStartEndDuringDev: false,
  vite:config     sourcemapIgnoreList: [Function: isInNodeModules$1]
  vite:config   },
  vite:config   builder: undefined,
  vite:config   preview: {
  vite:config     port: 4173,
  vite:config     strictPort: false,
  vite:config     host: undefined,
  vite:config     https: undefined,
  vite:config     open: false,
  vite:config     proxy: undefined,
  vite:config     cors: true,
  vite:config     headers: {}
  vite:config   },
  vite:config   envDir: 'C:/vite-preserve',
  vite:config   env: { BASE_URL: '/', MODE: 'production', DEV: false, PROD: true },        
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     warnOnce: [Function: warnOnce],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen],
  vite:config     hasErrorLogged: [Function: hasErrorLogged]
  vite:config   },
  vite:config   packageCache: Map(1) {
  vite:config     'fnpd_C:/vite-preserve' => {
  vite:config       dir: 'C:/vite-preserve',
  vite:config       data: {
  vite:config         name: 'vite-preserve',
  vite:config         version: '1.0.0',
  vite:config         main: 'index.js',
  vite:config         license: 'MIT',
  vite:config         packageManager: '[email protected]',
  vite:config         scripts: { dev: 'vite', build: 'vite build', serve: 'vite preview' },
  vite:config         devDependencies: {
  vite:config           '@types/node': '^22.10.2',
  vite:config           '@yarnpkg/sdks': '^3.2.0',
  vite:config           typescript: '^5.7.2',
  vite:config           vite: '^6.0.5'
  vite:config         }
  vite:config       },
  vite:config       hasSideEffects: [Function: hasSideEffects],
  vite:config       setResolvedCache: [Function: setResolvedCache],
  vite:config       getResolvedCache: [Function: getResolvedCache]
  vite:config     },
  vite:config     set: [Function (anonymous)]
  vite:config   },
  vite:config   worker: { format: 'iife', plugins: '() => plugins', rollupOptions: {} },   
  vite:config   appType: 'spa',
  vite:config   experimental: { importGlobRestoreExtension: false, hmrPartialAccept: false },
  vite:config   future: undefined,
  vite:config   ssr: {
  vite:config     target: 'node',
  vite:config     optimizeDeps: {
  vite:config       esbuildOptions: { preserveSymlinks: false },
  vite:config       include: [],
  vite:config       exclude: [],
  vite:config       needsInterop: [],
  vite:config       extensions: [],
  vite:config       holdUntilCrawlEnd: true,
  vite:config       force: false,
  vite:config       noDiscovery: true
  vite:config     },
  vite:config     external: [],
  vite:config     noExternal: [],
  vite:config     resolve: {
  vite:config       conditions: [ 'module', 'node', 'development|production' ],
  vite:config       externalConditions: [ 'node' ]
  vite:config     }
  vite:config   },
  vite:config   optimizeDeps: {
  vite:config     include: [],
  vite:config     exclude: [],
  vite:config     needsInterop: [],
  vite:config     extensions: [],
  vite:config     disabled: undefined,
  vite:config     holdUntilCrawlEnd: true,
  vite:config     force: false,
  vite:config     noDiscovery: false,
  vite:config     esbuildOptions: { preserveSymlinks: false }
  vite:config   },
  vite:config   dev: {
  vite:config     warmup: [],
  vite:config     createEnvironment: [Function: defaultCreateDevEnvironment],
  vite:config     recoverable: false,
  vite:config     moduleRunnerTransform: false
  vite:config   },
  vite:config   getSortedPlugins: [Function: getSortedPlugins],
  vite:config   getSortedPluginHooks: [Function: getSortedPluginHooks],
  vite:config   createResolver: [Function: createResolver],
  vite:config   fsDenyGlob: [Function: arrayMatcher],
  vite:config   safeModulePaths: Set(0) {}
  vite:config } +596ms
vite v6.0.5 building SSR bundle for production...
✓ 1 modules transformed.
dist/server/api/user/_id_/(post).mjs  0.04 kB
✓ built in 29ms
✓ 0 modules transformed.
x Build failed in 622ms
error during build:
Could not resolve entry module "index.html".
    at getRollupError (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/rollup-npm-4.29.0-891a59f877-10c0.zip/node_modules/rollup/dist/es/shared/parseAst.js:396:41)
    at error (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/rollup-npm-4.29.0-891a59f877-10c0.zip/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at ModuleLoader.loadEntryModule (file:///C:/Users/<USER>/AppData/Local/Yarn/Berry/cache/rollup-npm-4.29.0-891a59f877-10c0.zip/node_modules/rollup/dist/es/shared/node-entry.js:20161:20)
    at async Promise.all (index 0)

Validations

@sapphi-red
Copy link
Member

Rollup escapes [/] by default.
https://github.com/rollup/rollup/blob/5d3777803404c67ce14c62b8b05d6e26e46856f5/src/utils/sanitizeFileName.ts#L3
You can set build.rollupOptions.output.sanitizeFileName to configure that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants