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

build command fails when paths are passed via --assets-args #4436

Closed
irshadahmad21 opened this issue Feb 28, 2024 · 1 comment
Closed

build command fails when paths are passed via --assets-args #4436

irshadahmad21 opened this issue Feb 28, 2024 · 1 comment

Comments

@irshadahmad21
Copy link

Package version

6.3.1

Describe the bug

I am trying to create SSR build via vite and it fails like this

$ node ace build --assets-args=--"ssr=resources/js/ssr.tsx --outDir=public/assets/ssr"
[ info ] cleaning up output directory (build)
[ info ] compiling frontend assets (vite)
vite v5.1.4 building SSR bundle for production...
✓ 0 modules transformed.
x Build failed in 6ms
error during build:
RollupError: Could not resolve entry module "resources/js/ssr.tsx --outDir=public/assets/ssr".
    at error (file:///Users/projects/test/node_modules/.pnpm/rollup@4.9.6/node_modules/rollup/dist/es/shared/parseAst.js:337:30)
    at ModuleLoader.loadEntryModule (file:///Users/projects/test/node_modules/.pnpm/rollup@4.9.6/node_modules/rollup/dist/es/shared/node-entry.js:18043:20)
    at async Promise.all (index 0)

If I change the order of arguments inside --assets-args, e.g. --outDir before other flags, like this

node ace build --assets-args="--outDir=public/assets/ssr --ssr=resources/js/ssr.tsx"

It treats the whole string as outDir and outputs the assets inside public/assets/ssr --ssr=resources/js/ssr.tsx directory

Reproduction repo

No response

@irshadahmad21
Copy link
Author

Nevermind, passing separate flags works

node ace build --assets-args="--outDir=public/assets/ssr" --assets-args="--ssr=resources/js/ssr.tsx"

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

No branches or pull requests

1 participant