-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not produce json module to destination directory ? #665
Comments
I guess that the problem is that we don't load JSON files in |
I've tried using If i compile with But i tried using gulp because all my compiler using gulp. |
Now iam still using local tsc compiler to produce production js files. |
Hi, Have you known why since ?
This doesn't work either ? because it should, as it only loads the files and do nothing else. I'll look into this asap. |
1 month ago |
Now i copying json files manually with gulp.src(['src/**/*.json']).pipe(gulp.dest('dist')) And compiling typescript with gulp-typescript separately. |
Probably the issue is in gulp-typescript/lib/compiler.ts Lines 154 to 174 in b01326a
|
Thanks for the hint ! Just tested, that's indeed where the problem is. @dimaslanjaka Can you please revisit what is the behaviour of tsc regarding non js/ts files ? It this is to be solved, I want to follow tsc's Api. |
Sorry i dont understand what u mean. try test with:tsconfig.json {
"compilerOptions": {
"allowJs": true,
"checkJs": false,
"allowUnusedLabels": true,
"allowSyntheticDefaultImports": true,
"allowUmdGlobalAccess": true,
"allowUnreachableCode": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"experimentalDecorators": true,
"removeComments": false,
"declaration": true,
"declarationMap": false,
"declarationDir": "dist/types",
"outDir": "dist"
},
"include": ["src", "__test__"],
"exclude": ["src/lang"]
} src/index.ts import data from './data.json';
console.log(data); src/data.json ["data1", "data2"] gulpfile.ts import ts from "gulp-typescript";
import gulp from "gulp";
function compileTs(done) {
const tsProject = ts.createProject("tsconfig.json");
const tsResult = tsProject.src().pipe(tsProject());
return merge([tsResult.dts.pipe(gulp.dest("dist")), tsResult.js.pipe(gulp.dest("dist"))]);
}
exports.default = defaultTask; on terminal execute gulp Test Casesis |
i tried this 1 month ago, json files not copied into destination tsconfig.json. |
Does |
tsc copying only the json files because of |
I only need the json data that can be imported on js/ts |
rather than i modifying the ts variable, i prefer add/remove data on json files. |
the problem of this issue is |
so, iam using this for now.
|
data in JSON is also useful for specifying an interface or type. for example https://github.com/dimaslanjaka/hexo-seo/blob/compiler/src/html/schema/article/index.ts |
Expected behavior: JSON File (resolve json module) not copied into destination directory
Actual behavior: Not copying json files
Environment:
Your gulpfile:
Include your gulpfile, or only the related task (with
ts.createProject
).tsconfig.json
Include your tsconfig, if related to this issue.
Code
Include your TypeScript code, if necessary.
Source
Compiled
The text was updated successfully, but these errors were encountered: