1
1
import { spawn } from 'child_process' ;
2
- import { existsSync , statSync , copySync , writeFileSync , readFileSync } from 'fs-extra' ;
2
+ import { existsSync , statSync , writeFileSync , readFileSync } from 'fs-extra' ;
3
3
import { join , basename } from 'path' ;
4
4
import { task , src , dest } from 'gulp' ;
5
5
import { execTask , sequenceTask } from '../util/task_helpers' ;
@@ -15,7 +15,7 @@ const glob = require('glob');
15
15
const argv = minimist ( process . argv . slice ( 3 ) ) ;
16
16
17
17
// Matches all Typescript definition files for Material.
18
- const typingsGlob = join ( DIST_MATERIAL , '**/*.d.ts' ) ;
18
+ const typingsGlob = join ( DIST_MATERIAL , '**/*.+( d.ts|metadata.json) ' ) ;
19
19
// Matches the "package.json" and "README.md" file that needs to be shipped.
20
20
const assetsGlob = join ( COMPONENTS_DIR , '+(package.json|README.md)' ) ;
21
21
// Matches all UMD bundles inside of the bundles distribution.
@@ -35,11 +35,11 @@ task(':package:release', sequenceTask(
35
35
':package:metadata' ,
36
36
) ) ;
37
37
38
- /** Copy metatadata.json and associated d.ts files to the root of the package structure. */
38
+ /** Writes a re-export metadata */
39
39
task ( ':package:metadata' , ( ) => {
40
- // See: https://github.com/angular/angular/blob/master/build.sh#L293-L294
41
- copySync ( join ( DIST_MATERIAL , 'index. metadata.json' ) ,
42
- join ( DIST_RELEASE , 'material.metadata.json' ) ) ;
40
+ const metadataReExport =
41
+ `{"__symbolic":"module","version":3," metadata":{},"exports":[{"from":"./typings/index"}]}` ;
42
+ writeFileSync ( join ( DIST_RELEASE , 'material.metadata.json' ) , metadataReExport , 'utf-8' ) ;
43
43
} ) ;
44
44
45
45
/** Inlines the html and css resources into all metadata.json files in dist/ */
0 commit comments