evertonrobertoauler / cli-universal-demo

80 stars 18 forks source link

Adding ng bootstrap for twitter bootstrap cause failure to build npm start #16

Closed PSPanesar closed 7 years ago

PSPanesar commented 7 years ago

Hi, Thanks for the tutorial. I've setup the same steps for my angular 4 app which works fine but when i add ng-bootstrap with npm install --save then import it to my module with import {NgbModule} from ' and imports: [NgbModule.forRoot()] then the whole app fails to compile with npm start or production build. Could you help and let me know what is going wrong? Thanks

evertonrobertoauler commented 7 years ago

Try the @ng-bootstrap branch on this project or add the following code in your webpack.config.js file.

externals: [nodeExternals({ whitelist: [ /@ng-bootstrap\/ng-bootstrap/ ] })],

PSPanesar commented 7 years ago

Hi,

I'm fairly new to web pack and haven't gone into it yet. Could you help by letting me know where i can find the web pack.config.js file and what the syntax needs to be for that added line in the file? Would really be grateful for your help.

I was also thinking the crash could be coming from ngc as it serves the pre-rendered app?

Thank you.