problem using generator-angular2-library to import non-Angular dependencies (FullCalendar.io)
See original GitHub issueI have used generator-angular2-library to create a component to wrap and use FullCalendar http://fullcalender.io for Angular 4 projects, but found I cannot include and package the FullCalendar libraries properly within the generator-angular2-library generated component. The end result is that using in final application (like the one created from angular-cli), the component within the app cannot load reference to FullCalendar.io.
I have created 2 demos, one is the component itself created by generator-angular2-library, fullcalendar-ag4 https://github.com/kktam/fullcalendar-ag4. This is published in npm https://www.npmjs.com/package/fullcalendar-ag4.
The demo applicaton that consumes fullcalendar-ag4, is fullcalendar-app-ag4, https://github.com/kktam/fullcalendar-app-ag4.
Aftering installing and runnning
npm i
ng serve
Then the following error occurs during ng serve.
$ ng serve
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200 **
Hash: fdfb486dd1a1fc9bf051
Time: 33871ms
chunk {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {4} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.js.map (main) 5.41 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.18 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
ERROR in ./~/fullcalendar-ag4/index.js
Module not found: Error: Can't resolve 'fullcalendar/index' in '/Users/user/Documents/Work/angular2/fullcalendar-app-ag4/node_modules/fullcalendar-ag4'
@ ./~/fullcalendar-ag4/index.js 5:0-28
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
I have checked another example https://github.com/lbertenasco/ap-ng2-fullcalendar that uses hand crafted bundling method, and it fullcalendar is packaged correctly. Your help is most appreciated.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:25 (17 by maintainers)
Top GitHub Comments
@BenevidesLecontes — Thank you, really appreciate your help!
@kktam — Thank you for your follow-up 👍
@BenevidesLecontes — Thank you for your help, much appreciated! 👍
@kktam — Can you let us know if you got it working? Thanks!