Static GitHub Issues

[3314] Support webpack inline loaders for route components

prev: [edge] nuxt doesnt launch if only production dependencies installed
next: Error in installation notice when adding style language that isn't installed

What problem does this feature solve?

As a nuxt module author I want to specify a webpack loader only for a given route component using webpack inline loaders

In order to apply custom transformations to files that can not be explicitly targeted via webpack config. (for example when the same file is loaded twice with different loaders).

Problem:

The component path is made relative by utils#relativeTo which causes a component path like my-epic-loader?foo=bar!./pages/epic.vue to be prefixed like ../my-epic-loader?foo=bar!./pages/epic.vue - webpack can not handle this.

What does the proposed changes look like?

I'd propose to modify relativeTo to split the path by !, then make it relative and prepend the loader again.

I'd be happy to provide a PR

<!--cmty--><div align="right"><sub><em>This feature request is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c7042">#c7042</a>)</em></sub></div>