From e5abbfe1742a2fc5bf488dc32155b24ee4afc1c9 Mon Sep 17 00:00:00 2001 From: Miguel Alves Date: Fri, 20 Oct 2023 19:11:25 +0100 Subject: [PATCH 1/8] RDEV-5995 Fixed quotes in ViewGenerator --- ViewGenerator/ViewGenerator.csproj | 2 +- ViewGenerator/build/ViewGenerator.targets | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ViewGenerator/ViewGenerator.csproj b/ViewGenerator/ViewGenerator.csproj index d0b95a30..009699e7 100644 --- a/ViewGenerator/ViewGenerator.csproj +++ b/ViewGenerator/ViewGenerator.csproj @@ -7,7 +7,7 @@ ViewGenerator ViewGenerator Generates .NET View bindings from typescript - 1.1.9 + 1.1.10 ViewGenerator Library diff --git a/ViewGenerator/build/ViewGenerator.targets b/ViewGenerator/build/ViewGenerator.targets index 98751f36..647a74d5 100644 --- a/ViewGenerator/build/ViewGenerator.targets +++ b/ViewGenerator/build/ViewGenerator.targets @@ -139,19 +139,19 @@ - + - + - + From e768ff0730318ce6d0b703051e7595ce3a0b27df Mon Sep 17 00:00:00 2001 From: Miguel Alves Date: Mon, 23 Oct 2023 09:29:07 +0100 Subject: [PATCH 2/8] RDEV-5995 Fixed source maps in webpack (#155) --- ViewGenerator/ViewGenerator.csproj | 2 +- ViewGenerator/tools/webpack/Rules/Sass.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ViewGenerator/ViewGenerator.csproj b/ViewGenerator/ViewGenerator.csproj index 009699e7..ee75b4c9 100644 --- a/ViewGenerator/ViewGenerator.csproj +++ b/ViewGenerator/ViewGenerator.csproj @@ -7,7 +7,7 @@ ViewGenerator ViewGenerator Generates .NET View bindings from typescript - 1.1.10 + 1.1.11 ViewGenerator Library diff --git a/ViewGenerator/tools/webpack/Rules/Sass.ts b/ViewGenerator/tools/webpack/Rules/Sass.ts index 3dc17c93..f667b3b4 100644 --- a/ViewGenerator/tools/webpack/Rules/Sass.ts +++ b/ViewGenerator/tools/webpack/Rules/Sass.ts @@ -26,6 +26,7 @@ const SassRuleSet: RuleSetRule = { { loader: "sass-loader", options: { + sourceMap: true, sassOptions: { sourceMap: true, sourceMapContents: false From a2121c4ce24f92d24f826978e49d92b86abde4ff Mon Sep 17 00:00:00 2001 From: Miguel Alves Date: Mon, 23 Oct 2023 10:43:30 +0100 Subject: [PATCH 3/8] RDEV-5995 Fixed quotes in webpack configuration (#156) * Update ViewGenerator.targets * Update ViewGenerator.csproj --- ViewGenerator/ViewGenerator.csproj | 2 +- ViewGenerator/build/ViewGenerator.targets | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ViewGenerator/ViewGenerator.csproj b/ViewGenerator/ViewGenerator.csproj index ee75b4c9..584ca0a3 100644 --- a/ViewGenerator/ViewGenerator.csproj +++ b/ViewGenerator/ViewGenerator.csproj @@ -7,7 +7,7 @@ ViewGenerator ViewGenerator Generates .NET View bindings from typescript - 1.1.11 + 1.1.12 ViewGenerator Library diff --git a/ViewGenerator/build/ViewGenerator.targets b/ViewGenerator/build/ViewGenerator.targets index 647a74d5..98751f36 100644 --- a/ViewGenerator/build/ViewGenerator.targets +++ b/ViewGenerator/build/ViewGenerator.targets @@ -139,19 +139,19 @@ - + - + - + From 0934500c0199faf50876786419e3468c6225a7bb Mon Sep 17 00:00:00 2001 From: Miguel Alves Date: Mon, 23 Oct 2023 13:31:02 +0100 Subject: [PATCH 4/8] RDEV-5995 Fixed sanitization of command-line parameters (#157) * Revert "RDEV-5995 Fixed quotes in webpack configuration (#156)" This reverts commit a2121c4ce24f92d24f826978e49d92b86abde4ff. * RDEV-5995 Fixed sanitization of command-line parameters * CR --- ViewGenerator/ViewGenerator.csproj | 2 +- ViewGenerator/build/ViewGenerator.targets | 6 +++--- ViewGenerator/tools/webpack/Plugins/Utils.ts | 16 ++++++++++++---- ViewGenerator/tools/webpack/Rules/Files.ts | 8 ++++---- ViewGenerator/tools/webpack/tsconfig.json | 5 ++++- .../tools/webpack/webpack_plugins.config.ts | 4 ++-- .../tools/webpack/webpack_stylesheets.config.ts | 12 ++++++------ .../tools/webpack/webpack_views.config.ts | 8 +++++--- 8 files changed, 37 insertions(+), 24 deletions(-) diff --git a/ViewGenerator/ViewGenerator.csproj b/ViewGenerator/ViewGenerator.csproj index 584ca0a3..f96a3bb1 100644 --- a/ViewGenerator/ViewGenerator.csproj +++ b/ViewGenerator/ViewGenerator.csproj @@ -7,7 +7,7 @@ ViewGenerator ViewGenerator Generates .NET View bindings from typescript - 1.1.12 + 1.1.13 ViewGenerator Library diff --git a/ViewGenerator/build/ViewGenerator.targets b/ViewGenerator/build/ViewGenerator.targets index 98751f36..b849ba4b 100644 --- a/ViewGenerator/build/ViewGenerator.targets +++ b/ViewGenerator/build/ViewGenerator.targets @@ -139,19 +139,19 @@ - + - + - + diff --git a/ViewGenerator/tools/webpack/Plugins/Utils.ts b/ViewGenerator/tools/webpack/Plugins/Utils.ts index f31ff183..18e216c3 100644 --- a/ViewGenerator/tools/webpack/Plugins/Utils.ts +++ b/ViewGenerator/tools/webpack/Plugins/Utils.ts @@ -94,13 +94,21 @@ export function generateManifest( export function getCurrentDirectory() { return resolve("."); } + /* * Gets the filename from an array. * */ -export function getFileName(relativePaths: Dictionary, chunkData: any) { - const Directory: string = relativePaths[chunkData.chunk.name]; - if (Directory) { - return Directory + JsPlaceholder; +export function getFileName(relativePaths: Dictionary, chunkData: any): string { + const directory: string = relativePaths[chunkData.chunk.name]; + if (directory) { + return directory + JsPlaceholder; } return OutputDirectoryDefault + JsChunkPlaceholder; +} + +/* + * Sanitizes a command-line parameter + * */ +export function sanitizeCommandLineParam(parameter: string): string { + return parameter.replaceAll("'", ""); } \ No newline at end of file diff --git a/ViewGenerator/tools/webpack/Rules/Files.ts b/ViewGenerator/tools/webpack/Rules/Files.ts index 2f4394a8..b5a152b4 100644 --- a/ViewGenerator/tools/webpack/Rules/Files.ts +++ b/ViewGenerator/tools/webpack/Rules/Files.ts @@ -21,15 +21,15 @@ const getResourcesRuleSet = (assemblyName?: string, pluginsBase? : string): Rule } if (pathData.module) { - let module: NormalModule = pathData.module as NormalModule; + const module: NormalModule = pathData.module as NormalModule; if (module.resourceResolveData) { - let resourceResolveData = module.resourceResolveData; - let assemblyFileName = resourceResolveData.descriptionFileData.name; + const resourceResolveData = module.resourceResolveData; + const assemblyFileName = resourceResolveData.descriptionFileData.name; if (assemblyFileName.toUpperCase() === assemblyName.toUpperCase()) { return assemblyName + '/' + pathData.filename; } - if (!!pluginsBase && assemblyFileName.toUpperCase() === pluginsBase.toUpperCase()) { + if (pluginsBase && assemblyFileName.toUpperCase() === pluginsBase.toUpperCase()) { return pluginsBase + '/' + pathData.filename; } diff --git a/ViewGenerator/tools/webpack/tsconfig.json b/ViewGenerator/tools/webpack/tsconfig.json index d170e315..1bf43337 100644 --- a/ViewGenerator/tools/webpack/tsconfig.json +++ b/ViewGenerator/tools/webpack/tsconfig.json @@ -3,7 +3,10 @@ "module": "commonjs", "target": "es6", "esModuleInterop": true, - "skipLibCheck": true + "skipLibCheck": true, + "lib": [ + "ES2021.String" + ] }, "compileOnSave": true, "exclude": [ diff --git a/ViewGenerator/tools/webpack/webpack_plugins.config.ts b/ViewGenerator/tools/webpack/webpack_plugins.config.ts index 60aad28f..b4c62865 100644 --- a/ViewGenerator/tools/webpack/webpack_plugins.config.ts +++ b/ViewGenerator/tools/webpack/webpack_plugins.config.ts @@ -4,11 +4,11 @@ import getCommonConfiguration from "./Plugins/CommonConfiguration"; import DtsCleanupPlugin from "./Plugins/DtsCleanupPlugin"; import DtsGeneratorPlugin from "./Plugins/DtsGeneratorPlugin"; import { DtsFileName } from "./Plugins/Resources"; -import { getCurrentDirectory } from "./Plugins/Utils"; +import { getCurrentDirectory, sanitizeCommandLineParam } from "./Plugins/Utils"; const config = (env) => { - let standardConfig: Configuration = getCommonConfiguration("Plugins", env.useCache, env.assemblyName); + const standardConfig: Configuration = getCommonConfiguration("Plugins", env.useCache, sanitizeCommandLineParam(env.assemblyName)); (standardConfig.cache as any).name = "pluginsCache"; diff --git a/ViewGenerator/tools/webpack/webpack_stylesheets.config.ts b/ViewGenerator/tools/webpack/webpack_stylesheets.config.ts index 9e988cbe..da4ccee1 100644 --- a/ViewGenerator/tools/webpack/webpack_stylesheets.config.ts +++ b/ViewGenerator/tools/webpack/webpack_stylesheets.config.ts @@ -4,7 +4,7 @@ import { Configuration } from "webpack"; import MiniCssExtractPluginCleanup from "./Plugins/MiniCssExtractPluginCleanup"; import { CssPlaceholder, JsMapPlaceholder, OutputDirectoryDefault } from "./Plugins/Resources"; -import { Dictionary, getCurrentDirectory } from "./Plugins/Utils" +import { Dictionary, getCurrentDirectory, sanitizeCommandLineParam } from "./Plugins/Utils" import getResourcesRuleSet from "./Rules/Files"; import SassRuleSet from "./Rules/Sass"; @@ -12,15 +12,15 @@ import SassRuleSet from "./Rules/Sass"; const config = (env) => { const getEntryName = (entryPath: string): string => { - let fileExtensionLen: number = entryPath.length - entryPath.lastIndexOf("."); + const fileExtensionLen: number = entryPath.length - entryPath.lastIndexOf("."); return entryPath.slice(entryPath.replace(/\//g, '\\').lastIndexOf("\\") + 1, -fileExtensionLen); }; - let entries: string = env.entryPath; + let entries: string = sanitizeCommandLineParam(env.entryPath); let entryMap: Dictionary = {}; entries.split(";").map(entryPath => entryMap[getEntryName(entryPath)] = './' + entryPath) - - let stylesheetsConfig: Configuration = { + + const stylesheetsConfig: Configuration = { entry: entryMap, output: { @@ -42,7 +42,7 @@ const config = (env) => { module: { rules: [ SassRuleSet, - getResourcesRuleSet(env.assemblyName) + getResourcesRuleSet(sanitizeCommandLineParam(env.assemblyName)) ] }, diff --git a/ViewGenerator/tools/webpack/webpack_views.config.ts b/ViewGenerator/tools/webpack/webpack_views.config.ts index 0ec6eaec..fa0fc3bf 100644 --- a/ViewGenerator/tools/webpack/webpack_views.config.ts +++ b/ViewGenerator/tools/webpack/webpack_views.config.ts @@ -3,7 +3,7 @@ import { resolve } from "path"; import { Configuration } from "webpack"; import getCommonConfiguration from "./Plugins/CommonConfiguration"; -import { Dictionary } from "./Plugins/Utils"; +import { Dictionary, sanitizeCommandLineParam } from "./Plugins/Utils"; const config = (env) => { @@ -34,8 +34,10 @@ const config = (env) => { throw new Error("Extended configuration file not found."); } }; + + const sanitizedPluginsRelativePath: string = sanitizeCommandLineParam(env.pluginsRelativePath); - let standardConfig: Configuration = getCommonConfiguration("Views", env.useCache, env.assemblyName, env.pluginsRelativePath); + const standardConfig: Configuration = getCommonConfiguration("Views", env.useCache, sanitizeCommandLineParam(env.assemblyName), sanitizedPluginsRelativePath); (standardConfig.cache as any).name = "viewsCache"; @@ -55,7 +57,7 @@ const config = (env) => { } }; - generateExtendedConfig(env.pluginsRelativePath || ".", !!env.pluginsRelativePath); + generateExtendedConfig(sanitizedPluginsRelativePath || ".", !!sanitizedPluginsRelativePath); // resolve.alias if (Object.keys(aliasMap).length > 0) { From a8b26adab0030dea26656dbd989a50e058e43a1b Mon Sep 17 00:00:00 2001 From: Miguel Alves Date: Mon, 23 Oct 2023 15:17:45 +0100 Subject: [PATCH 5/8] RDEV-5995 Removed node dependency (#158) --- ViewGenerator/ViewGenerator.csproj | 2 +- ViewGenerator/build/ViewGenerator.targets | 28 +---------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/ViewGenerator/ViewGenerator.csproj b/ViewGenerator/ViewGenerator.csproj index f96a3bb1..dd749f15 100644 --- a/ViewGenerator/ViewGenerator.csproj +++ b/ViewGenerator/ViewGenerator.csproj @@ -7,7 +7,7 @@ ViewGenerator ViewGenerator Generates .NET View bindings from typescript - 1.1.13 + 1.1.14 ViewGenerator Library diff --git a/ViewGenerator/build/ViewGenerator.targets b/ViewGenerator/build/ViewGenerator.targets index b849ba4b..189ccbdf 100644 --- a/ViewGenerator/build/ViewGenerator.targets +++ b/ViewGenerator/build/ViewGenerator.targets @@ -1,15 +1,12 @@  - - VG_UnlinkNodeModules; VG_CleanEntryFiles; VG_CleanJSFiles; VG_CleanCSSFiles; VG_Clean; $(CleanDependsOn); - 12.18.4 @@ -17,36 +14,13 @@ - - <_ViewGeneratorNodeJsExe Include="$(MSBuildThisFileDirectory)..\..\..\Node.js.redist\$(NodeVersion)\tools\win-x64\node.exe"/> - <_ViewGeneratorNodeJsExe Include="$(MSBuildThisFileDirectory)..\..\Node.js.redist.$(NodeVersion)\tools\win-x64\node.exe"/> - - - <_ViewGeneratorNodeJsExe Include="$(MSBuildThisFileDirectory)..\..\..\Node.js.redist\$(NodeVersion)\tools\osx-x64\node"/> - <_ViewGeneratorNodeJsExe Include="$(MSBuildThisFileDirectory)..\..\Node.js.redist.$(NodeVersion)\tools\osx-x64\node"/> - - - <_ViewGeneratorCoreNodeJsExeAfterCheckedPaths Include="@(_ViewGeneratorCoreNodeJsExe)" Condition="Exists('%(FullPath)')" /> - $([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)..\")) $(ViewGeneratorPath)tools $(ViewGeneratorPath)contentFiles\ - <__ViewGeneratorNodeJsExe>@(_ViewGeneratorCoreNodeJsExeAfterCheckedPaths); - $(__ViewGeneratorNodeJsExe.Substring(0, $(__ViewGeneratorNodeJsExe.IndexOf(';')))) - - - - - - - - - - @@ -125,7 +99,7 @@ - + From 61544c81e7f844121d5ee0ed0b5d978f7ccea3a4 Mon Sep 17 00:00:00 2001 From: Miguel Alves Date: Wed, 25 Oct 2023 18:56:08 +0100 Subject: [PATCH 6/8] RDEV-5995 Fixed public path of generated scripts (#159) --- ViewGenerator/ViewGenerator.csproj | 2 +- ViewGenerator/tools/webpack/Plugins/CommonConfiguration.ts | 2 +- ViewGenerator/tools/webpack/Rules/Files.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ViewGenerator/ViewGenerator.csproj b/ViewGenerator/ViewGenerator.csproj index dd749f15..72a1d9eb 100644 --- a/ViewGenerator/ViewGenerator.csproj +++ b/ViewGenerator/ViewGenerator.csproj @@ -7,7 +7,7 @@ ViewGenerator ViewGenerator Generates .NET View bindings from typescript - 1.1.14 + 1.1.15 ViewGenerator Library diff --git a/ViewGenerator/tools/webpack/Plugins/CommonConfiguration.ts b/ViewGenerator/tools/webpack/Plugins/CommonConfiguration.ts index c2334cff..c4d66eb6 100644 --- a/ViewGenerator/tools/webpack/Plugins/CommonConfiguration.ts +++ b/ViewGenerator/tools/webpack/Plugins/CommonConfiguration.ts @@ -81,7 +81,7 @@ let getCommonConfiguration = (libraryName: string, useCache: boolean, assemblyNa libraryTarget: "window", globalObject: "window", devtoolNamespace: libraryName, - publicPath: "/" + publicPath: "/" + assemblyName + "/" }, node: false, diff --git a/ViewGenerator/tools/webpack/Rules/Files.ts b/ViewGenerator/tools/webpack/Rules/Files.ts index b5a152b4..5771a9e1 100644 --- a/ViewGenerator/tools/webpack/Rules/Files.ts +++ b/ViewGenerator/tools/webpack/Rules/Files.ts @@ -8,6 +8,7 @@ const getResourcesRuleSet = (assemblyName?: string, pluginsBase? : string): Rule type: 'asset/resource', generator: { emit: false, + publicPath: "/", filename: (pathData: PathData, _assetInfo?: AssetInfo): string => { const fileName: string = pathData.filename; if (fileName.indexOf(`/.pnpm/`) > 0) { From ed4f8bfd1ea618d67a7ed71363cdfb949ce0aa2b Mon Sep 17 00:00:00 2001 From: Miguel Alves Date: Thu, 26 Oct 2023 11:18:58 +0100 Subject: [PATCH 7/8] RDEV-5995 Introducing hot reload again (#160) --- ViewGenerator/ViewGenerator.csproj | 2 +- .../tools/webpack/Plugins/CommonConfiguration.ts | 4 ++-- ViewGenerator/tools/webpack/Rules/TypeScript.ts | 4 ++-- ViewGenerator/tools/webpack/webpack_views.config.ts | 9 ++++++--- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ViewGenerator/ViewGenerator.csproj b/ViewGenerator/ViewGenerator.csproj index 72a1d9eb..65b19078 100644 --- a/ViewGenerator/ViewGenerator.csproj +++ b/ViewGenerator/ViewGenerator.csproj @@ -7,7 +7,7 @@ ViewGenerator ViewGenerator Generates .NET View bindings from typescript - 1.1.15 + 1.1.16 ViewGenerator Library diff --git a/ViewGenerator/tools/webpack/Plugins/CommonConfiguration.ts b/ViewGenerator/tools/webpack/Plugins/CommonConfiguration.ts index c4d66eb6..a79d8d13 100644 --- a/ViewGenerator/tools/webpack/Plugins/CommonConfiguration.ts +++ b/ViewGenerator/tools/webpack/Plugins/CommonConfiguration.ts @@ -22,7 +22,7 @@ import SassRuleSet from "../Rules/Sass"; import getTypeScriptRuleSet from "../Rules/TypeScript"; import ForkTsCheckerWebpackPlugin from "fork-ts-checker-webpack-plugin"; -let getCommonConfiguration = (libraryName: string, useCache: boolean, assemblyName?: string, pluginsRelativePath?: string): Configuration => { +let getCommonConfiguration = (libraryName: string, useCache: boolean, assemblyName?: string, pluginsRelativePath?: string, forHotReload?: boolean): Configuration => { const entryMap: Dictionary = {} const outputMap: Dictionary = {}; @@ -98,7 +98,7 @@ let getCommonConfiguration = (libraryName: string, useCache: boolean, assemblyNa rules: [ SassRuleSet, getResourcesRuleSet(assemblyName, pluginsAssembly), - getTypeScriptRuleSet() + getTypeScriptRuleSet(forHotReload) ] }, diff --git a/ViewGenerator/tools/webpack/Rules/TypeScript.ts b/ViewGenerator/tools/webpack/Rules/TypeScript.ts index b385f2d0..126005c3 100644 --- a/ViewGenerator/tools/webpack/Rules/TypeScript.ts +++ b/ViewGenerator/tools/webpack/Rules/TypeScript.ts @@ -2,7 +2,7 @@ import { RuleSetRule, RuleSetUseItem } from "webpack"; // .ts / .tsx files -const getTypeScriptRuleSet = (): RuleSetRule => { +const getTypeScriptRuleSet = (forHotReload: boolean): RuleSetRule => { const TypeScriptRule: RuleSetRule = { test: /\.tsx?$/i, @@ -27,7 +27,7 @@ const getTypeScriptRuleSet = (): RuleSetRule => { }; // thread-loader, ts-loader - TypeScriptRule.use = ruleSet.concat(threadLoaderRule, tsLoaderRule); + TypeScriptRule.use = forHotReload ? ruleSet.concat(tsLoaderRule) : ruleSet.concat(threadLoaderRule, tsLoaderRule); return TypeScriptRule; } diff --git a/ViewGenerator/tools/webpack/webpack_views.config.ts b/ViewGenerator/tools/webpack/webpack_views.config.ts index fa0fc3bf..e241b2b8 100644 --- a/ViewGenerator/tools/webpack/webpack_views.config.ts +++ b/ViewGenerator/tools/webpack/webpack_views.config.ts @@ -37,7 +37,7 @@ const config = (env) => { const sanitizedPluginsRelativePath: string = sanitizeCommandLineParam(env.pluginsRelativePath); - const standardConfig: Configuration = getCommonConfiguration("Views", env.useCache, sanitizeCommandLineParam(env.assemblyName), sanitizedPluginsRelativePath); + const standardConfig: Configuration = getCommonConfiguration("Views", env.useCache, sanitizeCommandLineParam(env.assemblyName), sanitizedPluginsRelativePath, env.forHotReload); (standardConfig.cache as any).name = "viewsCache"; @@ -78,10 +78,13 @@ const config = (env) => { ]; } - if (env.useCache) { + if (env.forHotReload) { // @ts-ignore standardConfig.devServer = { - disableHostCheck: true + client: { + overlay: false + }, + allowedHosts: "all" }; } From b978c9471b0a393a6eddd67fc694e3f9517ba7b4 Mon Sep 17 00:00:00 2001 From: Miguel Alves Date: Thu, 26 Oct 2023 14:15:16 +0100 Subject: [PATCH 8/8] RDEV-5995 Fixed hot-reload (#161) --- ViewGenerator/ViewGenerator.csproj | 2 +- ViewGenerator/tools/webpack/Plugins/Resources.ts | 5 ++++- ViewGenerator/tools/webpack/webpack_views.config.ts | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ViewGenerator/ViewGenerator.csproj b/ViewGenerator/ViewGenerator.csproj index 65b19078..7619aed3 100644 --- a/ViewGenerator/ViewGenerator.csproj +++ b/ViewGenerator/ViewGenerator.csproj @@ -7,7 +7,7 @@ ViewGenerator ViewGenerator Generates .NET View bindings from typescript - 1.1.16 + 1.1.17 ViewGenerator Library diff --git a/ViewGenerator/tools/webpack/Plugins/Resources.ts b/ViewGenerator/tools/webpack/Plugins/Resources.ts index ec710af9..a86d604c 100644 --- a/ViewGenerator/tools/webpack/Plugins/Resources.ts +++ b/ViewGenerator/tools/webpack/Plugins/Resources.ts @@ -16,4 +16,7 @@ export const CssChunkPlaceholder: string = "chunk_[contenthash].css"; export const NamePlaceholder: string = "[name]"; export const JsChunkPlaceholder: string = "chunk_[contenthash].js"; export const JsPlaceholder: string = "[name].js"; -export const JsMapPlaceholder: string = "[name].js.map"; \ No newline at end of file +export const JsMapPlaceholder: string = "[name].js.map"; +export const IdPlaceholder: string = "[id]"; +export const RuntimePlaceholder: string = "[runtime]"; +export const FullHashPlaceholder: string = "[fullhash]"; \ No newline at end of file diff --git a/ViewGenerator/tools/webpack/webpack_views.config.ts b/ViewGenerator/tools/webpack/webpack_views.config.ts index e241b2b8..c6db21ff 100644 --- a/ViewGenerator/tools/webpack/webpack_views.config.ts +++ b/ViewGenerator/tools/webpack/webpack_views.config.ts @@ -4,6 +4,7 @@ import { Configuration } from "webpack"; import getCommonConfiguration from "./Plugins/CommonConfiguration"; import { Dictionary, sanitizeCommandLineParam } from "./Plugins/Utils"; +import {FullHashPlaceholder, IdPlaceholder, OutputDirectoryDefault, RuntimePlaceholder} from "./Plugins/Resources"; const config = (env) => { @@ -79,6 +80,9 @@ const config = (env) => { } if (env.forHotReload) { + standardConfig.output.hotUpdateChunkFilename = OutputDirectoryDefault + IdPlaceholder + "." + FullHashPlaceholder + ".hot-update.js"; + standardConfig.output.hotUpdateMainFilename = OutputDirectoryDefault + RuntimePlaceholder + "." + FullHashPlaceholder + ".hot-update.json"; + // @ts-ignore standardConfig.devServer = { client: {