mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-28 11:10:12 +08:00
Also adding a new package, webpack, which is a plugin and loader for webpack that adds support for AoT. It is behind a `--aot` flag in the CLI that is supported by build and serve.
25 lines
840 B
JavaScript
25 lines
840 B
JavaScript
'use strict';
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const packageRoot = path.join(__dirname, '../packages');
|
|
|
|
// All the supported packages. Go through the packages directory and create a map of
|
|
// name => fullPath.
|
|
const packages = fs.readdirSync(packageRoot)
|
|
.map(pkgName => ({ name: pkgName, root: path.join(packageRoot, pkgName) }))
|
|
.filter(pkg => fs.statSync(pkg.root).isDirectory())
|
|
.reduce((packages, pkg) => {
|
|
let pkgJson = JSON.parse(fs.readFileSync(path.join(pkg.root, 'package.json'), 'utf8'));
|
|
let name = pkgJson['name'];
|
|
packages[name] = {
|
|
dist: path.join(__dirname, '../dist', pkg.name),
|
|
packageJson: path.join(pkg.root, 'package.json'),
|
|
root: pkg.root,
|
|
main: path.resolve(pkg.root, 'src/index.ts')
|
|
};
|
|
return packages;
|
|
}, {});
|
|
|
|
module.exports = packages; |