build: mark material and cdk packages as sideEffect-free for webpack v4 (#10816)

This change enables material and cdk packages to take advantage of webpacks more advanced optimizations
documented at https://github.com/webpack/webpack/tree/master/examples/side-effects

Our code is already side-effect free because otherwise @angular-devkit/build-optimizer would break it, so it's safe
to turn this on.
This commit is contained in:
Igor Minar
2018-04-12 13:04:28 -07:00
committed by tinayuangao
parent dec91ce08f
commit f1a33e90c1
3 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -28,5 +28,6 @@
},
"dependencies": {
"tslib": "^1.7.1"
}
},
"sideEffects": false
}
+2 -1
View File
@@ -29,5 +29,6 @@
"dependencies": {
"tslib": "^1.7.1"
},
"schematics": "./schematics/collection.json"
"schematics": "./schematics/collection.json",
"sideEffects": false
}
@@ -10,6 +10,7 @@ export function createEntryPointPackageJson(destDir: string, packageName: string
main: `../bundles/${packageName}-${entryPointName}.umd.js`,
module: `../esm5/${entryPointName}.es5.js`,
es2015: `../esm2015/${entryPointName}.js`,
sideEffects: false,
};
writeFileSync(join(destDir, 'package.json'), JSON.stringify(content, null, 2), 'utf-8');