grunt-typescript (version 0.8.0), last published in 2015, is an abandoned Grunt plugin designed to compile TypeScript files into JavaScript. It primarily supports older TypeScript language features (e.g., up to TypeScript 1.x) and is compatible with Grunt `~0.4.5` and Node.js `>=0.8.0`. This package is distinct from `grunt-ts` (TypeStrong/grunt-ts), which emerged as a more feature-rich and longer-maintained alternative, although `grunt-ts` itself is now in a mature maintenance phase. Due to its significant age and lack of updates, `grunt-typescript` is not suitable for modern TypeScript or Node.js projects and should be considered effectively abandoned. Users needing TypeScript compilation with Grunt should look at `grunt-ts` or `@nevware21/grunt-ts-plugin` instead.
npm install grunt-typescriptVerified import paths — ran on the pinned version, not inferred.
Shows basic configuration for compiling individual TypeScript files and concatenating multiple files into a single output, defining module and target options.
Re-set your output directory using the `rootDir` option or, as a temporary measure, `keepDirectoryHierarchy` (which is also slated for deprecation). For modern projects, migrate to `grunt-ts` or `@nevware21/grunt-ts-plugin`.
Plan to use `rootDir` instead for managing output directory structure when using a more actively maintained TypeScript compiler plugin.
For any project using modern TypeScript, migrate to a current TypeScript compiler plugin (like `grunt-ts` or `@nevware21/grunt-ts-plugin`) or a more contemporary build system (e.g., Webpack, Rollup, Vite).
Ensure your project uses `grunt@0.4.x` or consider migrating to a more recent Grunt TypeScript plugin like `grunt-ts` (which has better support for newer Grunt versions) or `@nevware21/grunt-ts-plugin`.
Downgrade your project's `grunt` dependency to `~0.4.5` in `package.json` and reinstall, or use `npm install grunt-typescript --legacy-peer-deps` (for npm 7+). Alternatively, migrate to `grunt-ts` or `@nevware21/grunt-ts-plugin` for compatibility with newer Grunt versions.
This package does not support modern TypeScript. You must either downgrade your TypeScript code to match the features supported by older TypeScript 1.x compilers, or, more realistically, migrate to a modern Grunt TypeScript plugin (like `grunt-ts` or `@nevware21/grunt-ts-plugin`) or a different build tool.
Review the task configuration in `Gruntfile.js`. If `basePath` is used, consider replacing it with `rootDir` (if your TypeScript compiler supports it) and adjust `dest` accordingly. Be aware of the `keepDirectoryHierarchy` option's planned deprecation. For concatenation, ensure `dest` specifies a filename (`.js`) and not a directory.
When aiming to concatenate all TypeScript files into a single JavaScript file, the `dest` option must specify the *name* of the output file, including the `.js` extension (e.g., `dest: 'build/app.js'`), rather than just a directory.