-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't include 'ng2-bootstrap' external dependency #468
Comments
You need to install the type definitions for moment: typings install moment --ambient --save You may also need to install momentjs in case it is a peerDependency. |
after installing momentjs & its type definition:
|
I almost have it: had to install without the flag --ambient.
ng2-boostrap do have a node_modules folder with moment in it, but it cannot find it. |
Now you need to configure systemjs in config.ts. Just set path to the momentjs bundle. |
Right, still using SystemJS for dev, thanks! |
Failed to load resource: the server responded with a status of 404 (Not Found) I think this is the same issue. npm install moment --save How do I configure systemjs in config.ts? DEV_NPM_DEPENDENCIES or PROD_NPM_DEPENDENCIES? |
@raoel you likely need this in
|
In your system.js please tell system to look for moment.js as the default file. Moment is installed with some other js files as well. valor-software/ngx-bootstrap#663 (comment) There you go. Solved it for me. |
@NathanWalker How does your solution map onto the new-look tools/config.ts which references tools/config/project.config.ts which extends tools/config/seed.config.ts? In tools/config/project.config.ts I have:
but during npm run build.prod this still gives me:
There doesn't seem to be any way to provide the 'map' solution that @raoel mentions.... |
Is it a possibility to work with SystemJS for you? There you can provide map paths. |
Thanks @alfakappa - I was working with SystemJS in my dev environment and had ng2-bootstrap/moment working with the following in my systemjs.config.js: EDIT: See note from @alphakappa below about this not being the right way to do it in case you've arrived here browsing for solutions!
However I thought the angular2-seed looked as if it was going to give me the easiest route to building my project for deployment so have just spent all morning getting it working in this...and it doesn't seem to be using SystemJS? Is there a 'map' equivalent in angular2-seed? |
you should not use .js in your var map. use it only in packages. map is not correct when using a final path. packages just tells which file to start with (which is actually moment.js) but needs a reference path to include other files in moment.js. It will take it from map. if you make that a "moment.js" it will look for a folder moment.js (which does not exist) take a look at the issue I referenced. It gives an exact systemjs config file which works fine. |
Thanks @alfakappa - I've abandoned the SystemJS build now anyway, now that I have got it working and deployable in angular2-seed, but have edited my comment above for the benefit of those arriving here looking for solutions. |
Use these commands to add these dependencies to your package.json var map = { Then, U are good to go for moment. |
Tried to include ng2-bootstrap, but during building I got this message:
The text was updated successfully, but these errors were encountered: