首页 > 解决方案 > how to hide the folder path from webpack require() in Angular

问题描述

like this one: (its all over the debug console of the webpage)

__webpack_require__("../../../../../src/app/error/error.component.ts");

I don't want the users to see the folder structure of the app, Is there a way to hide those folder paths?

标签: angularwebpack

解决方案


The short answer: I had to build the Angular project with this command:

ng build --prod --aot=true

setting the prod to true and AOT to true (Ahead of time compilation) fixed the problem and the files are generated to full js and their name and folder paths are hidden completely


推荐阅读