- Notifications
You must be signed in to change notification settings - Fork919
Allow "layer" and "issuerLayer" rule properties#1809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The "layer" and "issuerLayer" rules are useful experimental properties that are currently stripped out by the Vue Loader plugin. This change fixes that issue.My specific use-case was to load SVG files as Vue components if they are imported into a script, but import them as URLs if I reference them in the CSS. Layers make this trivial:```module.exports = { experiments: { layers: true }, module: { rules: [ { test: /\.vue$/, loader: "vue-loader" }, { test: /\.vue$/, resourceQuery: /type=script/, layer: "script" }, { test: /\.[jt]s$/, layer: "script" }, { test: /\.svg$/i, oneOf: [ { loader: 'vue-svg-loader', issuerLayer: "script" }, { loader: 'file-loader' }, ], }, ], }};```
mrleblanc101 commentedAug 23, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Will this work in webpack 4 ? I'm trying to do something similar in Nuxt.
I couldnt' figure out why it's not working but when I look into the bundle code, there is no |
The "layer" and "issuerLayer" rules are useful experimental properties that are currently stripped out by the Vue Loader plugin. This change fixes that issue.
My specific use-case was to load SVG files as Vue components if they are imported into a script, but import them as URLs if I reference them in the CSS. Layers make this trivial: