aspnet core how to webpack build on deploy
Resolved using:in .csproj
:
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish"> <Exec Command="npm install" /> <Exec Command="npm run production" /></Target>
and adding scripts in my package.json
:
"scripts": { "dev": "cross-env NODE_ENV=development webpack --hide-modules", "production": "cross-env NODE_ENV=production webpack --hide-modules"}
this needs webpack
& cross-env
packages (and all other used packages during webpack) installed & a working webpack.config.js
Ask if someone is interrested to my webpack.config.js
or some other code