UNPKG

658 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var CommonChunksPlugin = require('webpack/lib/optimize/CommonsChunkPlugin');
4var Constants = require("../util/constants");
5var helpers_1 = require("../util/helpers");
6function getCommonChunksPlugin() {
7 return new CommonChunksPlugin({
8 name: 'vendor',
9 minChunks: checkIfInNodeModules
10 });
11}
12exports.getCommonChunksPlugin = getCommonChunksPlugin;
13function checkIfInNodeModules(webpackModule) {
14 return webpackModule && webpackModule.userRequest && webpackModule.userRequest.startsWith(helpers_1.getStringPropertyValue(Constants.ENV_VAR_NODE_MODULES_DIR));
15}