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
importfsfrom'node:fs'importpathfrom'node:path'constfiles=fs.globSync(pattern,{cwd: entryDir})for(constfileofsortRoutesByParams(files)){// Fix Windows slashesconstfilepath=file.replaceAll('\\','/')awaitimport(path.relative(entryDir,filepath))// ...}
as resolved
importfsfrom'node:fs'importpathfrom'node:path'constfiles=fs.globSync(pattern,{cwd: entryDir})for(constfileofsortRoutesByParams(files)){// Fix Windows slashesconstfilepath=file.replaceAll('\\','/')constresolved=path.relative(entryDir,filepath)awaitimport(resolved)// ...}
Current
VariableDynamicImportError: invalid import "import(path.relative(entryDir, filepath))". It cannot be statically analyzed. Variable dynamic imports must start with ./ and be limited to a specific directory. For example: import(`./foo/${bar}.js`). at dynamicImportToGlob (C:\project\.yarn\__virtual__\@rollup-plugin-dynamic-import-vars-virtual-469ce0e48e\5\Users\USER\AppData\Local\Yarn\Berry\cache\@rollup-plugin-dynamic-import-vars-npm-2.1.5-a03e1726af-10c0.zip\node_modules\@rollup\plugin-dynamic-import-vars\dist\cjs\index.js:99:11) at Object.enter (C:\project\.yarn\__virtual__\@rollup-plugin-dynamic-import-vars-virtual-469ce0e48e\5\Users\USER\AppData\Local\Yarn\Berry\cache\@rollup-plugin-dynamic-import-vars-npm-2.1.5-a03e1726af-10c0.zip\node_modules\@rollup\plugin-dynamic-import-vars\dist\cjs\index.js:169:26) at SyncWalker.visit (C:\Users\USER\AppData\Local\Yarn\Berry\cache\estree-walker-npm-2.0.2-dfab42f65c-10c0.zip\node_modules\estree-walker\dist\umd\estree-walker.js:116:17) at SyncWalker.visit (C:\Users\USER\AppData\Local\Yarn\Berry\cache\estree-walker-npm-2.0.2-dfab42f65c-10c0.zip\node_modules\estree-walker\dist\umd\estree-walker.js:153:12) at SyncWalker.visit (C:\Users\USER\AppData\Local\Yarn\Berry\cache\estree-walker-npm-2.0.2-dfab42f65c-10c0.zip\node_modules\estree-walker\dist\umd\estree-walker.js:153:12) at SyncWalker.visit (C:\Users\USER\AppData\Local\Yarn\Berry\cache\estree-walker-npm-2.0.2-dfab42f65c-10c0.zip\node_modules\estree-walker\dist\umd\estree-walker.js:153:12) at SyncWalker.visit (C:\Users\USER\AppData\Local\Yarn\Berry\cache\estree-walker-npm-2.0.2-dfab42f65c-10c0.zip\node_modules\estree-walker\dist\umd\estree-walker.js:146:19) at SyncWalker.visit (C:\Users\USER\AppData\Local\Yarn\Berry\cache\estree-walker-npm-2.0.2-dfab42f65c-10c0.zip\node_modules\estree-walker\dist\umd\estree-walker.js:146:19) at SyncWalker.visit (C:\Users\USER\AppData\Local\Yarn\Berry\cache\estree-walker-npm-2.0.2-dfab42f65c-10c0.zip\node_modules\estree-walker\dist\umd\estree-walker.js:153:12) at SyncWalker.visit (C:\Users\USER\AppData\Local\Yarn\Berry\cache\estree-walker-npm-2.0.2-dfab42f65c-10c0.zip\node_modules\estree-walker\dist\umd\estree-walker.js:146:19) { id: 'C:\\project\\src\\index.ts', hook: 'transform', code: 'PLUGIN_ERROR', plugin: 'rollup-plugin-dynamic-import-variables', watchFiles: [ 'C:\\project\\src\\index.ts' ]}
Expected
No error
The text was updated successfully, but these errors were encountered:
rtritto
changed the title
[@rollup/plugin-dynamic-import-vars] Ignore path.relative
[@rollup/plugin-dynamic-import-vars] Allow path.relativeDec 27, 2024
Feature Use Case
Load API routes using filesystem.
Feature Proposal
Ignore
path.relative
:Current
Expected
No error
The text was updated successfully, but these errors were encountered: