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, },