Skip to content

Commit 265a124

Browse files
committed
build: output re-export meatadata.json file in package root
1 parent 70547f4 commit 265a124

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tools/gulp/tasks/release.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {spawn} from 'child_process';
2-
import {existsSync, statSync, copySync, writeFileSync, readFileSync} from 'fs-extra';
2+
import {existsSync, statSync, writeFileSync, readFileSync} from 'fs-extra';
33
import {join, basename} from 'path';
44
import {task, src, dest} from 'gulp';
55
import {execTask, sequenceTask} from '../util/task_helpers';
@@ -15,7 +15,7 @@ const glob = require('glob');
1515
const argv = minimist(process.argv.slice(3));
1616

1717
// 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)');
1919
// Matches the "package.json" and "README.md" file that needs to be shipped.
2020
const assetsGlob = join(COMPONENTS_DIR, '+(package.json|README.md)');
2121
// Matches all UMD bundles inside of the bundles distribution.
@@ -35,11 +35,11 @@ task(':package:release', sequenceTask(
3535
':package:metadata',
3636
));
3737

38-
/** Copy metatadata.json and associated d.ts files to the root of the package structure. */
38+
/** Writes a re-export metadata */
3939
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');
4343
});
4444

4545
/** Inlines the html and css resources into all metadata.json files in dist/ */

0 commit comments

Comments
 (0)