admin管理员组文章数量:1320623
I'm trying to make some chrome extension which needs importing some files but it doesn't do that. Here is the code related to a problem: tsconfig.json
{
"compilerOptions": {
"target": "es6",
"lib": ["es2016", "dom", "dom.iterable"],
"module": "commonjs",
"rootDir": "src",
"typeRoots": [ "node_modules/@types" ],
"resolveJsonModule": true,
"sourceMap": true,
"outDir": "dist",
"noEmitOnError": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
imports.ts
export function hello()
{
console.log("hello")
}
importer.ts
import * as imports from "./imports"
imports.hello()
Error is
Uncaught ReferenceError: exports is not defined
And line of it is
Object.defineProperty(exports, "__esModule", { value: true });
本文标签: google chrome extensionTypescript doesn39t imports the fileStack Overflow
版权声明:本文标题:google chrome extension - Typescript doesn't imports the file - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742076556a2419445.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论