These are chat archives for AngularClass/angular2-webpack-starter

Aug 2017
Aug 30 2017 15:58

Hello All
I have a issue in AOT with tree shaking
Scenerio 1:
When I build by application with AOT, and then running the dist folder using http-server, the application opens in the browser and works fine, No issues here :grinning:.

Scenerio 2:
But when I add tree shaking code in my file : webpack.config.js along with AOT build

 new HtmlWebpackPlugin({ title: 'Tree-shaking' })

reference :

and on running the AOT build folder, the browser displays error in the console like ERROR Error: The selector "app" did not match any elements
leaving with blank screen
Now If I remove that tree-shaking code from web-pack and run the AOT build then the Application again works properly

Not Sure, what else is missing.
please have a look at my issue, and help me if you have any idea

and the AOT build is happening on the command npm run build:aot:prod