From 4e02f943f3f10381619dd60ceab3f227ba631507 Mon Sep 17 00:00:00 2001 From: "Hung-Han (Henry) Chen" <1474479+chenhunghan@users.noreply.github.com> Date: Mon, 14 Dec 2020 18:37:23 +0800 Subject: [PATCH] Correction of chuck name Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com> --- webpack.main.ts | 6 ++++-- webpack.renderer.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/webpack.main.ts b/webpack.main.ts index ff432cb04a..6e7af25ef8 100755 --- a/webpack.main.ts +++ b/webpack.main.ts @@ -1,7 +1,7 @@ import path from "path"; import webpack from "webpack"; import ForkTsCheckerPlugin from "fork-ts-checker-webpack-plugin"; -import { isDevelopment, isProduction, mainDir, buildDir } from "./src/common/vars"; +import { appName, isDevelopment, isProduction, mainDir, buildDir } from "./src/common/vars"; import nodeExternals from "webpack-node-externals"; import * as vars from "./src/common/vars"; @@ -39,10 +39,12 @@ export default function (): webpack.Configuration { // (for faster re-compiling) // https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366 splitChunks: isDevelopment ? { + // chunks can be shared even between async and non-async chunks chunks: "all", + name: `${appName}.main.chucks.js` } : false, runtimeChunk: isDevelopment ? { - name: (entrypoint: { name: string }) => `runtime-${entrypoint.name}`, + name: `${appName}.main.chucks.runtime.js`, } : false, }, module: { diff --git a/webpack.renderer.ts b/webpack.renderer.ts index bcf0214058..0fade85d9f 100755 --- a/webpack.renderer.ts +++ b/webpack.renderer.ts @@ -47,7 +47,6 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura publicPath, path: buildDir, filename: "[name].js", - chunkFilename: "chunks/[name].js", }, ignoreWarnings: [ /Critical dependency: the request of a dependency is an expression/, @@ -81,11 +80,14 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura // Automatically split vendor and commons in development // (for faster re-compiling) // https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366 + // @ts-ignore splitChunks: isDevelopment ? { + // chunks can be shared even between async and non-async chunks chunks: "all", + name: `${appName}.renderer.chucks.js` }: false, runtimeChunk: isDevelopment ? { - name: (entrypoint: { name: string }) => `runtime-${entrypoint.name}`, + name: `${appName}.renderer.chucks.runtime.js`, }: false, },