Skip to content

Commit

Permalink
fix(scripts): allow using same lib inside app
Browse files Browse the repository at this point in the history
Fix #2141
  • Loading branch information
filipesilva committed Jan 1, 2017
1 parent ba477d3 commit ef0d4af
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/angular-cli/models/webpack-build-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@ export function getWebpackCommonConfig(

// add entry points and lazy chunks
globalScripts.forEach(script => {
let scriptPath = `script-loader!${script.path}`;
if (script.lazy) { lazyChunks.push(script.entry); }
entryPoints[script.entry] = (entryPoints[script.entry] || []).concat(script.path);
});

// load global scripts using script-loader
extraRules.push({
include: globalScripts.map((script) => script.path), test: /\.js$/, loader: 'script-loader'
entryPoints[script.entry] = (entryPoints[script.entry] || []).concat(scriptPath);
});
}

Expand Down

0 comments on commit ef0d4af

Please sign in to comment.