I am run production mode using "npm run build:prod:aot"
after adding base href in index.html
<base href=".">
moved dist folder into xampp htdocs folder after getting 404 Error
I am having a same problem. Did u find a fix?
I am also having the same problem. I have moved dist folder into IIS.
Related Issue: https://github.com/akveo/ng2-admin/issues/1050
@raff90 @sridharan31 meanwhile dev team give any solution, i have created the gulp task for replacing all url /assets/xxxx/xxxx to ./assets/xxx/xxx. After replacing this i am not getting any errors.
gulpfile.js
var replace = require('gulp-replace');
var gulp = require('gulp');
gulp.task('templates', function(){
gulp.src(['dist/*.css','dist/*.js'])
.pipe(replace(':url(/assets', ':url(./assets'))
.pipe(gulp.dest('dist/'));
});
@AnisAli your method is work, but seems not good enough. I don't understand why change '/assets' to './assets' in src code will report error when npm run build.
@AnisAli I found another method: set the base-url path like this:
npm run build:prod --aot --base-href /QS_NG/
'/QS_NG/' is my deploy name
@dyh333 That's the correct solution, closing then.
For those of you who can't get it to work with <base href="./"> here is what worked for me:
<base href="./"> to the src/index.html head tagscripts: {
"packelectron-mac": "npm run build-electron-mac && npm run package-mac",
"build-electron-mac": "ng build --env=prod --base-href ~ && cp src/electron/* dist",
"package-mac": "electron-packager dist ProjectName --platform=darwin --electron-version=\"2.0.2\""
}
*Notice that you should use your own version of electron, mine is 2.0.2 (if you want to know the version type electron -v in the terminal)
$assets-root in src/app/theme/sass/conf/_variables.scss to this:$assets-root: '/ProjectName.app/Contents/Resources/app/assets';packelectron-mac script, that is npm run packelectron-mac
Most helpful comment
@AnisAli I found another method: set the base-url path like this:
npm run build:prod --aot --base-href /QS_NG/
'/QS_NG/' is my deploy name