-
Notifications
You must be signed in to change notification settings - Fork 12.8k
File enumeration order in directory-scanning mode should be deterministic #8776
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
Comments
Not blindly perhaps. tsconfig.json |
Yep, this should only be when no other ordering data is present |
I recently started using the glob based build system through the I had to resort to a rather 'ugly' workaround where I number the directories through a prefix to force a particular order: "compilerOptions": {
...
"outFile": "MyApp.js",
...
},
"include": [
"01_Extensions/**/*.js",
"01_Extensions/**/*.ts",
"02_Dependencies/**/*.js",
"02_Dependencies/**/*.ts",
"03_Library/**/*.ts",
"04_Program/**/*.ts",
...
] It seems to work, at least, but doesn't look very professional or like a permanent solution. It would be great if the globs would also provide ordering for the build process and resulting concatenated file. Thanks! |
Anyone still using outFile at this point has almost certainly figured this out; Won't Fix |
Repro: Set up
a.ts
,b.ts
, each with some statements, and atsconfig.json
in a folder usingoutFile
then compile.Result: Depending on which order the OS returns the files (which could change per machine), you might get one
a.ts
's contents beforeb.ts
, or afterWe should
.sort()
https://github.com/Microsoft/TypeScript/blob/adbf8fdee0c9f6ba46d106c4ca972e438511cbcb/src/compiler/commandLineParser.ts#L751 here so that TS builds are deterministicThe text was updated successfully, but these errors were encountered: