From 5de4aad5250452fcf1291107856c6e1871a2cf02 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Mon, 8 Jan 2018 12:15:45 -0500 Subject: [PATCH] exclude bitwarden modules from vendor --- package.json | 2 +- webpack.common.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c1f5d4025b..bcdfa8ffa4 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dev": "gulp build && webpack --config webpack.dev.js", "dev:watch": "gulp build && webpack --config webpack.dev.js --watch", "prod": "gulp build && webpack --config webpack.prod.js", - "dist": "gulp build && webpack --config webpack.prod.js && gulp dist", + "dist": "npm run prod && gulp dist", "lint": "tslint src/**/*.ts || true", "lint:fix": "tslint src/**/*.ts --fix", "test": "karma start --single-run", diff --git a/webpack.common.js b/webpack.common.js index 132b565c8e..64494ff53b 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -5,8 +5,13 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const isVendorModule = (module) => { - // returns true for everything in node_modules - return module.context && module.context.indexOf('node_modules') !== -1; + if (!module.context) { + return false; + } + + const nodeModule = module.context.indexOf('node_modules') !== -1; + const bitwardenModule = module.context.indexOf('@bitwarden') !== -1; + return nodeModule && !bitwardenModule; }; module.exports = {