grunt-ts
grunt-ts copied to clipboard
Configuration options are confusing
Hi guys,
I really don't get it. What is the correct typescript
configuration that is equivalent to:
grunt.initConfig({
config: {
tmp: 'build/tmp',
},
typescript: {
all: {
expand: true,
cwd: 'app/',
src: 'app/**/*.ts',
dest: '<%= config.tmp %>/',
},
},
});
What I want to achieve is:
app/m1/a.ts ---> build/tmp/m1/a.js
app/m2/b.ts ---> build/tmp/m2/b.js
etc.
The problems that I have:
-
cwd
options is not supported. -
dest
is not honoured
I tried
grunt.initConfig({
typescript: {
all: {
options: {
rootDir: 'app/',
},
expand: true,
src: 'app/**/*.ts',
outDir: '<%= config.web.tmp %>/',
},
},
});
But it did not work.
OK, I should remove the expand
options. The following config works as expected:
grunt.initConfig({
typescript: {
all: {
options: {
rootDir: 'app/',
},
// expand: true, <--- removed
src: 'app/**/*.ts',
outDir: '<%= config.web.tmp %>/',
},
},
});
Anyway, do you plan to support a stadndard grunt file configuration (cwd
, srd
, dest
)?
As I see it, it can be just a thin layer inside the plugin converting cwd
, src
and dest
options to typescript ones (out
, outDir
, rootDir
).
All are wrong. typescript:
is wrong. It should be ts:
:rose: (perhaps a simple typo?)
Docs : https://github.com/TypeStrong/grunt-ts#getting-started
Yeah, probably I've posted the issue to a wrong repo ))) I played interchangeably with grunt-ts
and grunt-typescript
. I found the both plugins confusing in the same way, probably because I'm not familiar with typescript compiler usage.
What about a support of a stadndard grunt file configuration (cwd
, src
, dest)
? Any plans to do it?
IMHO one of the main goals of such grunt plugin is translating grunt's standard configuration options to a specific options of the relevant backend.
While dest
directly is not supported, you can use the grunt standard files
mechanism with grunt-ts, which allows use of dest
. src
works as well. cwd
is not relevant.
We have no plans to change the API at this time.