tool(zipper): add support for the moduleId loader (#3394)

This commit is contained in:
Jesús Rodríguez 2017-03-19 21:24:24 +01:00 committed by GitHub
parent 223c944f24
commit d231f82b4a
1 changed files with 2 additions and 0 deletions

View File

@ -61,6 +61,7 @@ class ExampleZipper {
const exampleDirName = path.dirname(configFileName); const exampleDirName = path.dirname(configFileName);
const examplesPackageJson = 'public/docs/_examples/package.json'; const examplesPackageJson = 'public/docs/_examples/package.json';
const examplesSystemjsConfig = 'public/docs/_examples/_boilerplate/src/systemjs.config.js'; const examplesSystemjsConfig = 'public/docs/_examples/_boilerplate/src/systemjs.config.js';
const examplesSystemjsLoaderConfig = 'public/docs/_examples/_boilerplate/src/systemjs-angular-loader.js';
const exampleTsconfig = 'public/docs/_examples/_boilerplate/src/tsconfig.json'; const exampleTsconfig = 'public/docs/_examples/_boilerplate/src/tsconfig.json';
let exampleZipName = jsonFileName.replace(/(plnkr|zipper).json/, relativeDirName); let exampleZipName = jsonFileName.replace(/(plnkr|zipper).json/, relativeDirName);
const outputFileName = path.join(outputDirName, relativeDirName, exampleZipName + '.zip'); const outputFileName = path.join(outputDirName, relativeDirName, exampleZipName + '.zip');
@ -136,6 +137,7 @@ class ExampleZipper {
// also a systemjs config // also a systemjs config
if (!json.removeSystemJsConfig) { if (!json.removeSystemJsConfig) {
zip.append(fs.readFileSync(examplesSystemjsConfig, 'utf8'), { name: 'src/systemjs.config.js' }); zip.append(fs.readFileSync(examplesSystemjsConfig, 'utf8'), { name: 'src/systemjs.config.js' });
zip.append(fs.readFileSync(examplesSystemjsLoaderConfig, 'utf8'), { name: 'src/systemjs-angular-loader.js' });
} }
// a modified tsconfig // a modified tsconfig
let tsconfig = fs.readFileSync(exampleTsconfig, 'utf8'); let tsconfig = fs.readFileSync(exampleTsconfig, 'utf8');