@@ -20,7 +20,6 @@ const bundle_budget_1 = require("../../plugins/bundle-budget");
20
20
const cleancss_webpack_plugin_1 = require ( "../../plugins/cleancss-webpack-plugin" ) ;
21
21
const named_chunks_plugin_1 = require ( "../../plugins/named-chunks-plugin" ) ;
22
22
const scripts_webpack_plugin_1 = require ( "../../plugins/scripts-webpack-plugin" ) ;
23
- const webpack_2 = require ( "../../plugins/webpack" ) ;
24
23
const find_up_1 = require ( "../../utilities/find-up" ) ;
25
24
const utils_2 = require ( "./utils" ) ;
26
25
const ProgressPlugin = require ( 'webpack/lib/ProgressPlugin' ) ;
@@ -39,50 +38,10 @@ function getCommonConfig(wco) {
39
38
}
40
39
// tslint:disable-next-line:no-any
41
40
const extraPlugins = [ ] ;
42
- const extraRules = [ ] ;
43
41
const entryPoints = { } ;
44
42
const targetInFileName = utils_2 . getEsVersionForFileName ( utils_1 . fullDifferential ? buildOptions . scriptTargetOverride : tsConfig . options . target , buildOptions . esVersionInFileName ) ;
45
43
if ( buildOptions . main ) {
46
- const mainPath = path . resolve ( root , buildOptions . main ) ;
47
- entryPoints [ 'main' ] = [ mainPath ] ;
48
- if ( buildOptions . experimentalRollupPass ) {
49
- // NOTE: the following are known problems with experimentalRollupPass
50
- // - vendorChunk, commonChunk, namedChunks: these won't work, because by the time webpack
51
- // sees the chunks, the context of where they came from is lost.
52
- // - webWorkerTsConfig: workers must be imported via a root relative path (e.g.
53
- // `app/search/search.worker`) instead of a relative path (`/search.worker`) because
54
- // of the same reason as above.
55
- // - loadChildren string syntax: doesn't work because rollup cannot follow the imports.
56
- // Rollup options, except entry module, which is automatically inferred.
57
- const rollupOptions = { } ;
58
- // Add rollup plugins/rules.
59
- extraRules . push ( {
60
- test : mainPath ,
61
- // Ensure rollup loader executes after other loaders.
62
- enforce : 'post' ,
63
- use : [ {
64
- loader : webpack_2 . WebpackRollupLoader ,
65
- options : rollupOptions ,
66
- } ] ,
67
- } ) ;
68
- // Rollup bundles will include the dynamic System.import that was inside Angular and webpack
69
- // will emit warnings because it can't resolve it. We just ignore it.
70
- // TODO: maybe use https://webpack.js.org/configuration/stats/#statswarningsfilter instead.
71
- // Ignore all "Critical dependency: the request of a dependency is an expression" warnings.
72
- extraPlugins . push ( new webpack_1 . ContextReplacementPlugin ( / ./ ) ) ;
73
- // Ignore "System.import() is deprecated" warnings for the main file and js files.
74
- // Might still get them if @angular /core gets split into a lazy module.
75
- extraRules . push ( {
76
- test : mainPath ,
77
- enforce : 'post' ,
78
- parser : { system : true } ,
79
- } ) ;
80
- extraRules . push ( {
81
- test : / \. j s $ / ,
82
- enforce : 'post' ,
83
- parser : { system : true } ,
84
- } ) ;
85
- }
44
+ entryPoints [ 'main' ] = [ path . resolve ( root , buildOptions . main ) ] ;
86
45
}
87
46
let differentialLoadingNeeded = false ;
88
47
if ( wco . buildOptions . platform !== 'server' ) {
@@ -431,7 +390,6 @@ function getCommonConfig(wco) {
431
390
enforce : 'pre' ,
432
391
...sourceMapUseRule ,
433
392
} ,
434
- ...extraRules ,
435
393
] ,
436
394
} ,
437
395
optimization : {
0 commit comments