How the __tests__ directories can be ignored while running yarn build in production mode.
I have tried .nuxtignore but this did not work. any idea? Thank you
28 Replies
can you tell me what integration you use, so I can give you exact answer
Magento2 Integration for Vue Storefront 2
hi @mirza5339 👋 ,
please try add an ignore property in nuxt.config.js
Let me know if that does the trick.
ah, you can put a minus
-
at the front of the filename and it will be ignored.
what does your entry in the .nuxtignore look like?
next idea:
ah I see what i just sent wont work based on the path of the test
top is ignore rule from nuxt.config.js and at the bottom is example path
The issue is that these test paths generate errors while running yarn build in production mode because devDependencies are not loaded in production mode
Is this ignore rule correct?
The only part that might be incorrect is the dot . here:
can you try it without that dot
I have tried without dot
it does not even consider the ignore config
I'm not sure at the moment. 🤔 Let me mess with it a bit and get back to you. If you figure it out in the meantime please let me know.
ok thank you
I'm not getting any error when building. Can you tell me step by step how to reproduce the error?
@mirza5339
1. In you .env file change VSF_NUXT_APP_ENV=production
2. Do you have a test folder path as shown in this attached screenshot
3. run command yarn build
yup
no error. 🤔
try using WSL
The errors shown are for devDependencies
I tried on Digital Ocean app platform and had same issue
I'm not really familiar with Digital Ocean app platform
please give WSL a try and let me know if that helps
I dont know why it scans tests folders while running in production mode
are you using any rule to ignore these folders?
I've done nothing at all to the config
what's your yarn version? mein is 1.22.19
same version
have you tried wsl?
no
The issue is no longer occurring after deleting everything and cloning the project from the repo again, but this time devDependencies were installed even though it was a production build.
@skirianov Magento2 Integration for Vue Storefront 2 is not using .nuxtignore and the ignore rule in nuxt.config.js. I think this is a bug.