angularwebpack

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?


Solution

  • 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