harlan-zw / nuxt-webpack-optimisations

Make your Nuxt.js webpack builds faster ⚡
269 stars 8 forks source link

bug: fails on dev due to svg-loader #4

Closed debs-obrien closed 3 years ago

debs-obrien commented 3 years ago

Describe the bug Dev server doesn't work

To Reproduce Steps to reproduce the behavior:

  1. Clone repository https://github.com/debs-obrien/debbie.codes
  2. install module and run dev
  3. Module build failed (from ./node_modules/vue-svg-loader/index.js):

Expected behavior Generate works but dev doesn't

Screenshots

Screenshot 2021-02-11 at 13 10 15

Additional context Don't see any improvements in speed, removed node modules and yarn lock. Generation takes same time and dev takes same time but then breaks

debs-obrien commented 3 years ago

tested with this: imageFileLoader: false but still same error

harlan-zw commented 3 years ago

Thank you, will take a look tomorrow.

debs-obrien commented 3 years ago

actually adding imageFileLoader: false inside features as per docs 🙈 does work

AndrewBogdanovTSS commented 3 years ago

@loonpwn is there any way to exclude only specific files and not all images?

harlan-zw commented 3 years ago

@loonpwn is there any way to exclude only specific files and not all images?

Hey @AndrewBogdanovTSS

Would you mind sharing your use case for that behaviour? The replacement of the url-loader for file-loader should have no side effects on your app (assuming you are using the latest version).

If it is causing some issues then maybe there is something deeper I can look into fixing for you.

Otherwise as Debbie has said above, you can manually disable this feature using the config.

buildOptimisations: {
 //... 
 features: {
   imageFileLoader: false
 }
}
AndrewBogdanovTSS commented 3 years ago

@loonpwn I would only like to disable it for one file which is generated from @nuxtjs/svg-sprite - icons.svg, other files seems to have no issues with imageFileLoader