These are chat archives for AngularClass/NG6-starter

Feb 2018
Feb 23 2018 05:08
Hi Community, any one can help me regarding running dist on production
I am getting errors missing some libraries with dist/build
Feb 23 2018 05:28
so any one pls point me to right direction or any how to for setting up production environment for ng6 starter
Matias Fernandez Martinez
Feb 23 2018 13:31

Hi @techyboy, if you have problems adding libraries, you should do the following.
1 - Add the library to the package.json e.g.: "dependencies": { "angular-material": "^1.1.5" },
2 - in your app file add the import statement on your app.js file, e.g.: import ngMaterial from 'angular-material';
3 - If is an AngularJS Dependency, add the dependency on your main module e.g: angular.module('myApp, [ngMaterial]);

Note: Other libraries like jQuery might need to configuration on webpack.configfile using the ProvidePlugin.
If the library is not declared as a module, you will have to import the JS and CSS files manually:

import AngularMDDataTable from 'angular-material-data-table';
import 'angular-material-data-table/dist/md-data-table.css';
Feb 23 2018 14:51
yes thank you, mostly 404 errors were related to JS/CSS
btw what is best practices to run ng6 starter app on production server with pm2 daemonised approach with nginx reverse proxy? or any thing else?