问题描述
我正在这样做:
import { GlideRecord } from "@nuvolo/serviceNow-types/server/GlideRecord";
我有一个文件node_modules/@nuvolo/serviceNow-types/server/GlideRecord.d.ts
它包含:
...
type GlideRecordConstructor = { new <T>(table: string): GlideRecord<T> };
type GlideRecord<T> = GlideRecordBase<T> & T;
declare const GlideRecord: GlideRecordConstructor;
export { GlideRecord };
如果我运行tsc
可以正常运行,则没有错误
Webpack说:
未找到模块:错误:无法在...中解析'@ nuvolo / serviceNow-types / server / GlideRecord'
Webpack配置:
{
mode: "production",//set name of record as the library name
output: {
filename: "file.js"
},module: {
rules: [
{
test: /\.ts$/,use: 'ts-loader',//use: 'awesome-typescript-loader',exclude: /node_modules/,},],resolve: {
//modules: ['node_modules'],extensions: [ '.ts','.js' ],// Allows imports to work from .ts and .js
},}
tsconfig.json:
{
"transpile": false,"compilerOptions": {
"lib": ["es2015","dom"],"esModuleInterop": true,"baseUrl": ".","moduleResolution": "node","resolveJsonModule": true,"isolatedModules": true
}
}
我该如何解决?
我还在这里创建了GH问题:https://github.com/nuvolo/sincronia/issues/138
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)