Correction of chuck name

Signed-off-by: Hung-Han (Henry) Chen <1474479+chenhunghan@users.noreply.github.com>
This commit is contained in:
Hung-Han (Henry) Chen committed 2021-01-07 11:22:50 +08:00
1 parent ba6acfb20a
commit 4e02f943f3
2 files changed
+8 -4

No files matched your search

+4 -2
View File
@@ -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: {
+4 -2
View File
@@ -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,
},