1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 | var _constructorIndexInArray = require('./constructorIndexInArray');
|
8 |
|
9 | var _constructorIndexInArray2 = _interopRequireDefault(_constructorIndexInArray);
|
10 |
|
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | var getCommonsChunkFilename = function getCommonsChunkFilename(pluginOptions) {
|
21 |
|
22 | var commonsChunkPluginIndex = (0, _constructorIndexInArray2.default)(pluginOptions, 'CommonsChunkPlugin');
|
23 |
|
24 |
|
25 | var commonsChunkFilename = void 0;
|
26 | if (commonsChunkPluginIndex !== false) {
|
27 | var commonsChunkOptions = pluginOptions[commonsChunkPluginIndex];
|
28 |
|
29 | if (commonsChunkOptions.filenameTemplate === commonsChunkOptions.chunkNames) {
|
30 | commonsChunkFilename = commonsChunkOptions.chunkNames + '.js';
|
31 |
|
32 | } else if (commonsChunkOptions.filenameTemplate) {
|
33 | commonsChunkFilename = commonsChunkOptions.filenameTemplate;
|
34 |
|
35 | } else if (commonsChunkOptions.chunkNames) {
|
36 | commonsChunkFilename = commonsChunkOptions.chunkNames + '.js';
|
37 |
|
38 | } else {
|
39 |
|
40 | console.log('[CarteBlanche] We detected you use the CommonsChunkPlugin, ' + 'but we could not detect the filename of the common chunk. Please use the ' + '"filename" option of the CommonsChunkPlugin.');
|
41 | }
|
42 | }
|
43 | return commonsChunkFilename;
|
44 | };
|
45 |
|
46 | exports.default = getCommonsChunkFilename; |
\ | No newline at end of file |