NetCore Webpack generates broken links in Prod builds
I'm submitting a bug report
- Library Version: 0.33.1
Please tell us about your environment:
-
Operating System: Windows 10
-
Node Version: 8.10.0
-
NPM Version: 6.1.0
-
Browser: all?
-
Language: TypeScript 2.8.1
-
Loader/bundler: Webpack
Current behavior: Files loaded with file-loader get no prefix in path but they are put in 'dist'. This makes IIS look for them under the 'wwwroot' folder instead of 'wwwroot/dist'.
- What is the expected behavior? Files should have baseUrl 'dist/' instead of '/'.
Hey @anwnqvis 👋
is this when using javascriptservices or not?
Using aurelia-cli v1.2.3, I was able to resolve this issue by changing the production build script in package.json to:
"build": "webpack --env.production --extractCss --config webpack.netcore.config.js"
Could/should the aurelia-cli be updated to use the .net core specific config file when generating a new .net core project?
I don't use .net, but this sounds right. @Sayan751 ☝️ could you help to review the above proposal?
@3cp Frankly, I have looked into the generated skeleton for netcore for the first time today :) There are couple of things I find to be confusing.
- The usage of a a second config file for netcore. why not generate just the correct one for netcore in the first go. Also I see that
var originalConfig = webpackConfig({});is not passing any arguments from cli to the webpack config, as it is the case normally. - It seems that the usage of
Microsoft.AspNetCore.SpaServices.Webpackis now deprecated. So we need to upgrade the netcore skeleton anyway.
I think it is better to take a closer look at the generated skeleton, and do some cleanup as well as the necessary upgarde.