From f3f0b8fc907ebe0be80265da03a16996c09518fa Mon Sep 17 00:00:00 2001 From: George Drak Date: Thu, 12 Aug 2021 10:49:07 +0500 Subject: [PATCH] Revert "Embed js files until .net 6 is fixed https://github.com/dotnet/sdk/pull/19482" This reverts commit 8185b2eb8fd5f5efea2315fb998869f7ef11dfb3. --- src/Sitko.Blockly.Blazor/.gitignore | 1 - src/Sitko.Blockly.Blazor/Helpers/JsHelper.cs | 16 +++++-------- .../Sitko.Blockly.Blazor.csproj | 24 +++++++++---------- .../Web/webpack.config.js | 2 +- 4 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/Sitko.Blockly.Blazor/.gitignore b/src/Sitko.Blockly.Blazor/.gitignore index fdd4b64..701678b 100644 --- a/src/Sitko.Blockly.Blazor/.gitignore +++ b/src/Sitko.Blockly.Blazor/.gitignore @@ -1,2 +1 @@ wwwroot -Web/dist diff --git a/src/Sitko.Blockly.Blazor/Helpers/JsHelper.cs b/src/Sitko.Blockly.Blazor/Helpers/JsHelper.cs index 6201150..dd2ea88 100644 --- a/src/Sitko.Blockly.Blazor/Helpers/JsHelper.cs +++ b/src/Sitko.Blockly.Blazor/Helpers/JsHelper.cs @@ -4,19 +4,15 @@ public class JsHelper { - // TODO: .NET 6 Preview 7 sdk can't pack multiple files as static web assets. Return to static web assets when .NET 6 is fixed. - // TODO: Probably https://github.com/dotnet/sdk/pull/19482. Try in RC1. - public static ScriptInjectRequest TwitchScriptRequest { get; } = ScriptInjectRequest.FromResource( + public static ScriptInjectRequest TwitchScriptRequest { get; } = ScriptInjectRequest.FromUrl( "blocklyTwitch", - typeof(JsHelper).Assembly, - "blocklyTwitch.js"); + "/_content/Sitko.Blockly.Blazor/blocklyTwitch.js"); - public static ScriptInjectRequest TwitterScriptRequest { get; } = ScriptInjectRequest.FromResource( + public static ScriptInjectRequest TwitterScriptRequest { get; } = ScriptInjectRequest.FromUrl( "blocklyTwitter", - typeof(JsHelper).Assembly, - "blocklyTwitter.js"); + "/_content/Sitko.Blockly.Blazor/blocklyTwitter.js"); - public static ScriptInjectRequest FormsScriptRequest { get; } = ScriptInjectRequest.FromResource( - "blocklyForms", typeof(JsHelper).Assembly, "blocklyForms.js"); + public static ScriptInjectRequest FormsScriptRequest { get; } = ScriptInjectRequest.FromUrl( + "blocklyForms", "/_content/Sitko.Blockly.Blazor/blocklyForms.js"); } } diff --git a/src/Sitko.Blockly.Blazor/Sitko.Blockly.Blazor.csproj b/src/Sitko.Blockly.Blazor/Sitko.Blockly.Blazor.csproj index 1e1b17a..6382db3 100644 --- a/src/Sitko.Blockly.Blazor/Sitko.Blockly.Blazor.csproj +++ b/src/Sitko.Blockly.Blazor/Sitko.Blockly.Blazor.csproj @@ -20,20 +20,18 @@ true - - - + + + + + + + + + - - - - - - - - - - + + diff --git a/src/Sitko.Blockly.Blazor/Web/webpack.config.js b/src/Sitko.Blockly.Blazor/Web/webpack.config.js index 059d36d..64abc33 100644 --- a/src/Sitko.Blockly.Blazor/Web/webpack.config.js +++ b/src/Sitko.Blockly.Blazor/Web/webpack.config.js @@ -23,7 +23,7 @@ const config = { }, output: { filename: '[name].js', - path: path.resolve(__dirname, 'dist'), + path: path.resolve(__dirname, '..', 'wwwroot'), } }; module.exports = (env, argv) => {