简体   繁体   中英

Run Aurelia CLI app from a directory

I would like to deploy my app to a virtual directory. I have been unable to figure out the correct configuration needed to run the app locally with a similar structure. For example, I'd like to run it from:

http://localhost:8080/demos

I have tried every combination of adding "demos" to publicPath and contentBase in my webpack config. The errors just between 404's on static assets and router errors from Aurelia.

It is documented by Aurelia router, you can add base tag to index.html header, <base href="/demos"> , and set router root config.options.root = "/demos"; in configureRouter() .

In addition, if your bundled js files are indeed served from directory, you need to modified baseDir in 2 places of aurelia.json : platform.baseDir and build.targets[0].baseDir .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM