Skip to content

Commit ef0d4af

Browse files
committed
fix(scripts): allow using same lib inside app
Fix #2141
1 parent ba477d3 commit ef0d4af

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

packages/angular-cli/models/webpack-build-common.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,9 @@ export function getWebpackCommonConfig(
5656

5757
// add entry points and lazy chunks
5858
globalScripts.forEach(script => {
59+
let scriptPath = `script-loader!${script.path}`;
5960
if (script.lazy) { lazyChunks.push(script.entry); }
60-
entryPoints[script.entry] = (entryPoints[script.entry] || []).concat(script.path);
61-
});
62-
63-
// load global scripts using script-loader
64-
extraRules.push({
65-
include: globalScripts.map((script) => script.path), test: /\.js$/, loader: 'script-loader'
61+
entryPoints[script.entry] = (entryPoints[script.entry] || []).concat(scriptPath);
6662
});
6763
}
6864

0 commit comments

Comments
 (0)