我有一个index.ts文件可以导出我所有的助手函数。为了以更方便的方式导入它们,我想使用export asTypeScript 3.8 的功能。
所以这是我的代码:
// index.ts
export * from './logging';
export * as TypeHelper from './types';
export * as ValidationHelper from './validation';
这是我在运行时遇到的错误npm run serve:
ERROR Failed to compile with 1 errors 13:44:55
error in ./src/services/helpers/index.ts
Module parse failed: Unexpected token (2:9)
File was processed with these loaders:
* ./node_modules/cache-loader/dist/cjs.js
* ./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader/index.js
* ./node_modules/eslint-loader/index.js
You may need an additional loader to handle the result of these loaders.
| export * from './logging';
> export * as TypeHelper from './types';
| export * as ValidationHelper from './validation';
|
@ ./src/plugins/router/index.ts 3:0-41 92:8-11 98:8-11
@ ./src/main.ts
@ multi (webpack)-dev-server/client?http://192.168.179.4:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.ts
Type checking in progress...
No type errors found
Version: typescript 3.9.7
我怎样才能解决这个问题?
牧羊人nacy
相关分类