Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Asset Size Chunks Chunk Names
- app.js 59 KiB app.js [emitted] app.js
- 8b8859a786899546e270.js 14.5 KiB ccApp, ccDesignSystem, ccUser [emitted] ccApp, ccDesignSystem, ccUser
- vendor.js 5.07 MiB vendor.js [emitted] vendor.js
- Entrypoint ccApp = vendor.js app.js 8b8859a786899546e270.js
- Entrypoint ccDesignSystem = 8b8859a786899546e270.js
- Entrypoint ccUser = 8b8859a786899546e270.js
- */
- 'use strict';
- const {resolve} = require('path');
- const src = resolve(`${__dirname}/../src`);
- const ccApp = `${src}/ccApp`;
- const ccDesignSystem = `${src}/ccDesignSystem`;
- const ccUser = `${src}/ccUser`;
- module.exports = {
- entry: {
- ccApp: `${src}/ccApp/ngApp.module.js`,
- ccDesignSystem: `${src}/ccDesignSystem/ccDesignSystem.module.js`,
- ccUser: `${src}/ccUser/ccUser.module.js`
- },
- devtool: 'inline-source-map',
- output: {
- chunkFilename: '[name]'
- },
- module: {
- rules: [
- {
- test: /\.html$/,
- use: [
- {
- loader: 'ngtemplate-loader',
- options: {
- exportAsDefault: true,
- relativeTo: src,
- requireAngular: true
- }
- },
- {
- loader: 'html-loader',
- options: {
- minimize: true
- }
- }
- ]
- },
- {
- test: /\.js$/,
- use: {
- loader: 'babel-loader',
- options: {
- extends: `${__dirname}/babel.config.js`,
- inputSourceMap: true,
- sourceMaps: 'inline'
- }
- }
- }
- ]
- },
- optimization: {
- splitChunks: {
- chunks: 'all',
- cacheGroups: {
- ccApp: {
- name: 'app.js',
- test: ({userRequest}) => userRequest && userRequest.startsWith(ccApp)
- },
- ccAppVendors: {
- name: 'vendor.js',
- test: /node_modules/
- },
- ccDesignSystem: {
- name: 'design-system.js',
- test: ({userRequest}) => userRequest && userRequest.startsWith(ccDesignSystem)
- },
- ccUser: {
- name: 'user-registration.js',
- test: ({userRequest}) => userRequest && userRequest.startsWith(ccUser)
- }
- }
- }
- }
- };
Add Comment
Please, Sign In to add comment