Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow "layer" and "issuerLayer" rule properties #1809

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 17, 2021

  1. Allow "layer" and "issuerLayer" rule properties

    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' },
            ],
          },
        ],
      }
    };
    ```
    stevethedev committed Mar 17, 2021
    Configuration menu
    Copy the full SHA
    aae6134 View commit details
    Browse the repository at this point in the history