chore: unify deps version (#9829)

This commit is contained in:
neverland
2021-11-10 10:34:42 +08:00
committed by GitHub
parent 8d1d029f5d
commit d65714601e
12 changed files with 130 additions and 647 deletions

View File

@@ -1,26 +0,0 @@
/**
* @babel/preset-typescript 不支持编译 Vue 文件中的 ts 代码
* 通过手动添加 @babel/plugin-transform-typescript 的方式来解决这个问题
* see: https://github.com/babel/babel-loader/pull/738
*/
const { readFileSync } = require('fs');
const { declare } = require('@babel/helper-plugin-utils');
module.exports = declare(() => ({
overrides: [
{
test: (filePath) => {
if (/\.vue$/.test(filePath)) {
const template = readFileSync(filePath, { encoding: 'utf8' });
return (
template.includes('lang="ts"') || template.includes("lang='ts'")
);
}
return false;
},
plugins: [require('@babel/plugin-transform-typescript')],
},
],
}));

View File

@@ -17,7 +17,6 @@ module.exports = function (api, options) {
},
],
require.resolve('@babel/preset-typescript'),
require('./babel-preset-vue-ts.cjs'),
],
plugins: [
[