@plugin-light/webpack-loader-replace-vue-key
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

Vue 中 key 转换

替换 Vue 文件key的表示,以解决编译报错。

:key="'type' + index"

转为

:key="`type-${index}`"

如何使用

安装

pnpm add @plugin-light/webpack-loader-replace-vue-key -D

vue.config.js 中添加如下设置:

const { LOADER as replaceVueKey } = require('webpack-loader-replace-vue-key')';

module.export = {
  chainWebpack(config) {
    config.module
      .rule('vue')
      .test(/\.vue$/)
      .use(replaceVueKey)
      .loader(replaceVueKey)
      .end();
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @plugin-light/webpack-loader-replace-vue-key

Weekly Downloads

68

Version

0.0.7

License

none

Unpacked Size

3.84 kB

Total Files

8

Last publish

Collaborators

  • yanggwcn