Skip to content
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

Configuration options are confusing #316

Open
korya opened this issue Dec 21, 2015 · 5 comments
Open

Configuration options are confusing #316

korya opened this issue Dec 21, 2015 · 5 comments
Labels

Comments

@korya
Copy link

korya commented Dec 21, 2015

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.

@korya
Copy link
Author

korya commented Dec 21, 2015

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 %>/',
    },
  },
});

@korya
Copy link
Author

korya commented Dec 21, 2015

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).

@basarat
Copy link
Member

basarat commented Dec 24, 2015

All are wrong. typescript: is wrong. It should be ts: 🌹 (perhaps a simple typo?)

Docs : https://github.com/TypeStrong/grunt-ts#getting-started

@korya
Copy link
Author

korya commented Dec 24, 2015

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.

@nycdotnet
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants