cklwblove / blog

记录日常遇到的bug
1 stars 0 forks source link

vue-cli babel exclude file #95

Open cklwblove opened 2 years ago

cklwblove commented 2 years ago

babel.config.js 里添加相关的配置

const plugins = [];
plugins.push(
  [
    'import',
    {
      libraryName: '@winner-fed/win-ui',
      libraryDirectory: 'es',
      style: true
    },
    '@winner-fed/win-ui'
  ]
);
module.exports = {
  presets: [
    [
      '@vue/cli-plugin-babel/preset',
      {
        useBuiltIns: 'entry'
      }
    ]
  ],
  plugins,
 // 添加忽略 babel 编译的文件
  exclude: ['./src/assets/js/demo.js']
};