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

Possibility of changing export path based on provided argument #76

Closed
Rashair opened this issue Nov 27, 2022 · 2 comments · Fixed by #80
Closed

Possibility of changing export path based on provided argument #76

Rashair opened this issue Nov 27, 2022 · 2 comments · Fixed by #80

Comments

@Rashair
Copy link

Rashair commented Nov 27, 2022

I have this setup in package.json

    "build": "next build && next export -o ../api/Web/wwwroot && next-image-export-optimizer",
    "build:docker": "next build && next-image-export-optimizer && next export -o .export",

How do I change the nextImageExportOptimizer_exportFolderPath dynamically based on the command?

@Niels-IO
Copy link
Owner

Hi @Rashair,

currently, this is not supported. A solution would be to accept a command line argument for it, just as you have shown with next export. I will look into it in the next few weeks. If you want, you can also provide a PR for it.

@Rashair
Copy link
Author

Rashair commented Dec 3, 2022

Thanks 👍🏻 As for now I made a workaround with cross-env.
package.json:

    "build:docker": "next build && next export -o .export && cross-env MODE=docker next-image-export-optimizer",

And next.config.js:

nextImageExportOptimizer_exportFolderPath: env.MODE === "docker" ? ".export" : "../api/Cognity.Web/wwwroot",

@Niels-IO Niels-IO linked a pull request Dec 9, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants