How to deploy unplugin-icons on production?
For a SolidStart project, I'm using this library https://github.com/antfu/unplugin-icons as Icon Components. I follow the instructions in the page and have it working on local perfectly.
However as I deploy to production, using Docker, I got this error
The Docker file is
This is due to the fact that unplugin-icons is declared in package.json as devDependency (as told by the library), so when it is installed in PRODUCTION mode, it cannot find the module.
Has anyone got it working on production? What is the proper way to use this library?
GitHub
GitHub - antfu/unplugin-icons: 🤹 Access thousands of icons as compo...
🤹 Access thousands of icons as components on-demand universally. - GitHub - antfu/unplugin-icons: 🤹 Access thousands of icons as components on-demand universally.
1 Reply
I tried with the dockerfile in https://stackoverflow.com/questions/74222441/how-to-yarn-build-on-dockerfile, where it
yarn build
as dev first, then remove the node_modules and reinstall as production. It is successfully deployed to the server (I'm using Gitlab CI/CD), but still got the same error on server.Stack Overflow
How to yarn build on Dockerfile
I try to build a Docker image executing the code:
docker build . -t <YOUR_DOCKER_HUB_USERNAME>/my-nuxt-project
It is about a nuxt.js project but when I run the code I receive the following er...