You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
unbundle + import from parent folder: Invalid substitution "../x" for placeholder "[name]" in "output.chunkFileNames" pattern, can be neither absolute nor relative path
#16
import{defineConfig}from"vite"importpathfrom'path'import{chunkSplitPlugin}from'vite-plugin-chunk-split'constassetsDir='';constoutputDefaults={// remove hashes from filenamesentryFileNames: `${assetsDir}[name].js`,// Invalid substitution "../index" for placeholder "[name]" in "output.chunkFileNames" pattern, can be neither absolute nor relative path.chunkFileNames: `${assetsDir}[name].js`,assetFileNames: `${assetsDir}[name].[ext]`,}exportdefaultdefineConfig({base: "./",clearScreen: false,build: {outDir: path.resolve('../docs'),emptyOutDir: true,target: 'esnext',minify: false,rollupOptions: {output: {
...outputDefaults,}},},plugins: [chunkSplitPlugin({strategy: 'unbundle',})],})
workarounds
constassetsDir='';constoutputDefaults={// remove hashes from filenamesentryFileNames: `${assetsDir}[name].js`,// import from parent folder// https://github.com/sanyuan0704/vite-plugin-chunk-split/issues/16// Invalid substitution "../index" for placeholder "[name]" in "output.chunkFileNames" pattern, can be neither absolute nor relative path.//chunkFileNames: `${assetsDir}[name].js`,// workarounds ...chunkFileNames: (file)=>{//console.dir(file.name); throw new Error("x");// Invalid pattern ".._index.js" for "output.chunkFileNames", patterns can be neither absolute nor relative paths. If you want your files to be stored in a subdirectory, write its name without a leading slash like this: subdirectory/pattern.//return file.name.replace(/\//g, "_") + ".js" // docs/.._index.js//return file.name.replace(/\//g, "_").replace(/^\./, "+") + ".js" // docs/+._index.js//return file.name.replace(/\.\.\//g, "_") + ".js" // docs/_index.jsreturnfile.name.replace(/\.\.\//g,".parent/")+".js"// docs/.parent/index.js},assetFileNames: `${assetsDir}[name].[ext]`,}
The text was updated successfully, but these errors were encountered:
"import from parent folder" is a common pattern in the
demo/
folder of a projectprobably this is a "wontfix" because all solutions can be wrong (filepath collisions)
index.js
error
repro https://github.com/milahu/vite-plugin-chunk-split-repro
vite.config.js
workarounds
The text was updated successfully, but these errors were encountered: