![](/img/trans.png)
[英]How to access using php a json file located in the src folder in ReactJS
[英]How to build to output folder when the typescript files are located in './src'
我有的:
./src/myfile.ts
./test/mytest.spec.ts
tsc应该在./build
位置创建一个javascript( myfile.js
)和定义文件( myfile.d.ts
)。
我的tsconfig.ts:
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"rootDir": ".",
"outDir": "./build",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"declaration": true
},
"files": [
"./src/index.ts"
],
"exclude": [
".vscode",
".git",
"build",
"node_modules",
"test"
],
"compileOnSave": false,
"buildOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
但是,此配置文件在./build/src/
子文件夹中生成myfile.js
。
请注意,我不能使用"rootDir": "./src"
因为这样就不会编译测试文件夹(使用karma + webpack运行测试时会出现问题吗?)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.