I'm trying to load TypeScript class dynamicaly. But after compilation browser says there is 404 error. Browser tries to load file from the project root. But I need to load it from directory that differs from root. How can I configure it?
webpack.config.js
:
tsconfig.json
:
I tried to look for issues in the web. But I found nothing. Thanks in advance!
Wepback has publicPath
configuration that represents destination root inside the project. So dynamically loading modules is going to be looked at this directory.
I found this information here: http://code.fitness/post/2016/02/webpack-public-path-and-hot-reload.html
webpack.config.js
after updating:
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.