ypyf / svelte-preprocess-remove-attribute

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Usage

Assume that you want to remove data-test attribute from svelte component. In your webpack.config.js:

module: {
    rules: [
      {
        test: /\.(html|svelte)$/,
        exclude: /node_modules/,
        use: {
          loader: 'svelte-loader',
          options: {
            preprocess: [
              require('svelte-preprocess')({}),
              require('svelte-preprocess-remove-attribute')({
                filter: name => {
                  return name !== 'data-test';
                },
              }),
            ],
          },
        },
      },
    ],
  },

About


Languages

Language:JavaScript 100.0%