After upgrading to aurelia-cli 1.1.0 (same problem with 1.1.1) when I build a dist and try to run it from IIS virtual folder, aurelia won’t load scripts from correct path 192.168.1.2/testapp but from 192.168.1.2 only. It does not respect the virtual directory settings in webpack.config.js.
Before I would just do:
publicPath: production ? '/testapp/' : '/'
and all would jsut work, but doing the same not makes not difference. Any ideas what am i doing wrong?
1 Like
Not sure how you did before, but you need to modify one more to match the path.
new HtmlWebpackPlugin({
template: 'index.ejs',
metadata: {
// available in index.ejs //
title, baseUrl: production ? '/testapp/' : '/'
}
}),
1 Like
I’m setting both
output: {
path: outDir,
publicPath: production ? '/testApp/' : '/',
filename: production ? '[name].[chunkhash].bundle.js' : '[name].[hash].bundle.js',
sourceMapFilename: production ? '[name].[chunkhash].bundle.map' : '[name].[hash].bundle.map',
chunkFilename: production ? '[name].[chunkhash].chunk.js' : '[name].[hash].chunk.js'
},
and
new HtmlWebpackPlugin({
template: 'index.ejs',
minify: production ? {
removeComments: true,
collapseWhitespace: true
} : undefined,
metadata: {
// available in index.ejs //
//title, baseUrl
title, baseUrl: production ? '/testApp/' : '/'
}
but the issue is still there. Still trying to load the scripts without accepting the virutal directory
http://192.168.1.2/runtime~app.25b3df30356ba1400fa2.bundle.js
1 Like
I have found the problem. After re-reading the README.md and run
npm run build
it all build fine. I t look like the old
au build --env prod
no longer works
1 Like
I see. The fix was on the way
1 Like
FYI, cli v1.2.0 now supports au build --env prod
.
1 Like
updated, thank you.
I wonder if this was intentional or accidental change
1 Like
It was an unintentional breaking change due to the big refactoring.
1 Like