Last active
July 16, 2016 12:00
-
-
Save ovrmrw/427a3961c27292e27493c8e056c2489b to your computer and use it in GitHub Desktop.
Copy *.ts and *.d.ts files from ./jspm_packages/npm/ to ./node_modules/@types/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Copy *.ts and *.d.ts files from ./jspm_packages/npm/ to ./node_modules/@types/ | |
| This tool is for TypeScript 2.0. | |
| */ | |
| const lodash = require('lodash'); | |
| const fs = require('fs-extra'); | |
| const path = require('path'); | |
| const root = path.resolve(); | |
| require('./jspm_packages/system.src'); // SystemJS | |
| require('./jspm.config'); // jspm config file | |
| console.log(SystemJS.map); | |
| lodash.forEach(SystemJS.map, (value, key) => { | |
| const npm = value.split(':')[0]; | |
| if (npm === 'npm') { | |
| console.log(key); // @angular/core | |
| const path = value.replace(':', '/'); | |
| console.log(path); // npm/@angular/[email protected] | |
| fs.copySync(root + '/jspm_packages/' + path, root + '/node_modules/@types/' + key, { filter: /\.ts/ }); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
下記のように書くことで、tsconfig.jsonに変換できました. 生成したtsconfig.json使ってcompile通せましたー。