Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@
"homepage": "https://github.com/angular/angular-cli",
"dependencies": {
"@angular-cli/ast-tools": "^1.0.0",
"@angular-cli/base-href-webpack": "^1.0.6",
"@angular/common": "~2.1.0",
"@angular/compiler": "~2.1.0",
"@angular/compiler-cli": "~2.1.0",
"@angular/core": "~2.1.0",
"@angular/platform-browser": "~2.1.0",
"@angular/platform-server": "~2.1.0",
"@angular/tsc-wrapped": "^0.3.0",
"@ngtools/webpack": "^1.1.4",
"angular2-template-loader": "^0.5.0",
"awesome-typescript-loader": "^2.2.3",
"chalk": "^1.1.3",
Expand Down
5 changes: 5 additions & 0 deletions packages/angular-cli/lib/config/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export interface CliConfig {
* Global scripts to be included in the build.
*/
scripts?: string[];
/**
* Global scripts to be used internally.
* See https://webpack.github.io/docs/library-and-externals.html
*/
externals: {[name: string]: string};
/**
* Name and corresponding file for environment config.
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/angular-cli/lib/config/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
},
"additionalProperties": false
},
"externals": {
"description": "Global scripts to be used internally.",
"type": "object",
"additionalProperties": true
},
"environments": {
"description": "Name and corresponding file for environment config.",
"type": "object",
Expand Down
2 changes: 2 additions & 0 deletions packages/angular-cli/models/webpack-build-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export function getWebpackCommonConfig(
const scripts = appConfig.scripts
? appConfig.scripts.map((script: string) => path.resolve(appRoot, script))
: [];
const externals = appConfig.externals || {};

let entry: { [key: string]: string[] } = {
main: [appMain]
Expand All @@ -43,6 +44,7 @@ export function getWebpackCommonConfig(
path: path.resolve(projectRoot, appConfig.outDir),
filename: '[name].bundle.js'
},
externals: externals,
module: {
rules: [
{
Expand Down