source: trip-planner-front/node_modules/@angular-devkit/build-angular/src/webpack/configs/browser.js@ 84d0fbb

Last change on this file since 84d0fbb was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago

primeNG components

  • Property mode set to 100644
File size: 3.0 KB
Line 
1"use strict";
2/**
3 * @license
4 * Copyright Google LLC All Rights Reserved.
5 *
6 * Use of this source code is governed by an MIT-style license that can be
7 * found in the LICENSE file at https://angular.io/license
8 */
9Object.defineProperty(exports, "__esModule", { value: true });
10exports.getBrowserConfig = void 0;
11const utils_1 = require("../../utils");
12const plugins_1 = require("../plugins");
13const helpers_1 = require("../utils/helpers");
14function getBrowserConfig(wco) {
15 const { buildOptions } = wco;
16 const { crossOrigin = 'none', subresourceIntegrity, extractLicenses, vendorChunk, commonChunk, allowedCommonJsDependencies, } = buildOptions;
17 const extraPlugins = [];
18 const { styles: stylesSourceMap, scripts: scriptsSourceMap, hidden: hiddenSourceMap, } = buildOptions.sourceMap;
19 if (subresourceIntegrity) {
20 const SubresourceIntegrityPlugin = require('webpack-subresource-integrity');
21 extraPlugins.push(new SubresourceIntegrityPlugin({
22 hashFuncNames: ['sha384'],
23 }));
24 }
25 if (scriptsSourceMap || stylesSourceMap) {
26 extraPlugins.push(helpers_1.getSourceMapDevTool(scriptsSourceMap, stylesSourceMap, buildOptions.differentialLoadingNeeded && !buildOptions.watch ? true : hiddenSourceMap, false));
27 }
28 let crossOriginLoading = false;
29 if (subresourceIntegrity && crossOrigin === 'none') {
30 crossOriginLoading = 'anonymous';
31 }
32 else if (crossOrigin !== 'none') {
33 crossOriginLoading = crossOrigin;
34 }
35 const buildBrowserFeatures = new utils_1.BuildBrowserFeatures(wco.projectRoot);
36 return {
37 devtool: false,
38 resolve: {
39 mainFields: ['es2015', 'browser', 'module', 'main'],
40 conditionNames: ['es2015', '...'],
41 },
42 output: {
43 crossOriginLoading,
44 trustedTypes: 'angular#bundler',
45 },
46 optimization: {
47 runtimeChunk: 'single',
48 splitChunks: {
49 maxAsyncRequests: Infinity,
50 cacheGroups: {
51 default: !!commonChunk && {
52 chunks: 'async',
53 minChunks: 2,
54 priority: 10,
55 },
56 common: !!commonChunk && {
57 name: 'common',
58 chunks: 'async',
59 minChunks: 2,
60 enforce: true,
61 priority: 5,
62 },
63 vendors: false,
64 defaultVendors: !!vendorChunk && {
65 name: 'vendor',
66 chunks: (chunk) => chunk.name === 'main',
67 enforce: true,
68 test: /[\\/]node_modules[\\/]/,
69 },
70 },
71 },
72 },
73 plugins: [
74 new plugins_1.CommonJsUsageWarnPlugin({
75 allowedDependencies: allowedCommonJsDependencies,
76 }),
77 ...extraPlugins,
78 ],
79 node: false,
80 };
81}
82exports.getBrowserConfig = getBrowserConfig;
Note: See TracBrowser for help on using the repository browser.