11 Answer(s)
-
0
I did not install webpack globally, the webpack I am using is 4.29.6, which can be used normally without encountering errors.
-
0
-
0
@exInt You can remove the
--watch
option."create-bundles": "webpack --progress --profile --watch --mode=development",
-
1
@exlnt It the "watching" feature of webpack that watch files changed and recomplie. check this using-watch-mode. Actually, it finished building and you can force to stop safely. But it stop CI/CD process. You can change the package.json(npm config file at Mvc project dir). like this.
"scripts": { "create-bundles": "webpack --progress --profile --watch --mode=development", "build": "webpack --mode=production", "create-bundles-no-watch": "webpack --progress --profile --mode=development" },
change "create-bundles" to remove "--watch" or add a new script like "create-bundles-no-watch" that remove "--watch" and use "npm run create-bundles-no-watch" instead of "npm run create-bundles".
at webpack production mode, building using "npm run build" will not hang.
-
0
@maliming, @nicolaslau - Thanks for the help! I added the below and it worked perfectly!
"create-bundles-dev": "webpack --progress --profile --mode=development",
I added all the "custom" bundles for my app into the bundles.json (see below) file (I copied and updated them from my V6.8 solution), however after the "create-bundles" runs I'm not seeing my bundles created? Do I need to do something additional?
"myAppScripts": [ { "outputFolder": "wwwroot/view-resources/Areas/MyApp/Views/ListValues/_CreateOrEditModal.min.js", "input": [ "wwwroot/view-resources/Areas/MyApp/Views/ListValues/_CreateOrEditModal.js" ], ///Code removed for brevity }
-
0
Hi @exlnt
You don't have to add view files to bundles.json, it is already added here https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Mvc/webpack.config.js#L17
-
0
Hi @nicolaslau
I think you have solved the original problem, right ?
-
0
@ismcagdas - Thanks! Question: I had created my own custom "bundles" for a group of scripts I use across many of my pages. How do I get that added/working?
-
0
@exlnt you can use the output directly in your page or the layout of many pages.
<script abp-src="/view-resources/Areas/AppAreaName/Views/_Bundles/my-custom-bundle-output.js" asp-append-version="true"></script>
note that
min.js
is handled (according to environment) via*ScriptSrcTagHelper
in ANZ project so that you do not need to handle non-minified and minified files yourself -
0
I started my own thread sorry for hijacking this thread! :-)
-
0
@ismcagdas this problem doesn`t occurs again after a fresh git operation. thanks.