Filter out some modules (#1198)

This commit is contained in:
Paulus Schoutsen 2018-05-20 21:19:47 -04:00 committed by GitHub
parent d1fcdfd5a3
commit 0edf06bfb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

1
src/util/empty.js Normal file
View File

@ -0,0 +1 @@
/* empty file that we alias some files to that we don't want to include */

View File

@ -44,6 +44,18 @@ function createConfig(isProdBuild, latestBuild) {
__VERSION__: JSON.stringify(VERSION),
}),
new CopyWebpackPlugin(copyPluginOpts),
// Ignore moment.js locales
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
// Color.js is bloated, it contains all color definitions for all material color sets.
new webpack.NormalModuleReplacementPlugin(
/@polymer\/paper-styles\/color\.js$/,
path.resolve(__dirname, 'src/util/empty.js')
),
// Ignore roboto pointing at CDN. We use local font-roboto-local.
new webpack.NormalModuleReplacementPlugin(
/@polymer\/font-roboto\/roboto\.js$/,
path.resolve(__dirname, 'src/util/empty.js')
),
];
if (latestBuild) {