A
Alokaiβ€’12mo ago
mirza

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
skirianov
skirianovβ€’12mo ago
can you tell me what integration you use, so I can give you exact answer
mirza
mirzaβ€’12mo ago
Magento2 Integration for Vue Storefront 2
rohrig
rohrigβ€’12mo ago
hi @mirza5339 πŸ‘‹ , please try add an ignore property in nuxt.config.js
export default {
// ...
ignore: [
'**/_tests_/**'
],
// ...
}
export default {
// ...
ignore: [
'**/_tests_/**'
],
// ...
}
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:
build: {
extend(config, { isClient, isServer }) {
if (isClient || isServer) {
// Exclude _tests_ directories from being bundled into your production build
config.module.rules.push({
test: /_tests_/,
loader: 'null-loader'
});
}
}
},
build: {
extend(config, { isClient, isServer }) {
if (isClient || isServer) {
// Exclude _tests_ directories from being bundled into your production build
config.module.rules.push({
test: /_tests_/,
loader: 'null-loader'
});
}
}
},
mirza
mirzaβ€’12mo ago
No description
rohrig
rohrigβ€’12mo ago
ah I see what i just sent wont work based on the path of the test
mirza
mirzaβ€’12mo ago
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?
rohrig
rohrigβ€’12mo ago
The only part that might be incorrect is the dot . here:
No description
rohrig
rohrigβ€’12mo ago
can you try it without that dot
mirza
mirzaβ€’12mo ago
I have tried without dot it does not even consider the ignore config
rohrig
rohrigβ€’12mo ago
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.
mirza
mirzaβ€’12mo ago
ok thank you
rohrig
rohrigβ€’12mo ago
I'm not getting any error when building. Can you tell me step by step how to reproduce the error? @mirza5339
mirza
mirzaβ€’12mo ago
1. In you .env file change VSF_NUXT_APP_ENV=production
mirza
mirzaβ€’12mo ago
2. Do you have a test folder path as shown in this attached screenshot
No description
mirza
mirzaβ€’12mo ago
3. run command yarn build
Want results from more Discord servers?
Add your server