angular2-logger icon indicating copy to clipboard operation
angular2-logger copied to clipboard

Bare-Butt CLI Fix

Open TheFirstDeity opened this issue 10 years ago • 4 comments

Simplest fix possible for the angular-cli issue #65. However, this is a breaking change that requires the api to be imported from angular2-logger instead of angular2-logger/core.

All it does is point es6 compatible tools at the dist/es6/core.js entry point as if it was an index.js in the root folder, and let's ts find core.d.ts as if it were index.d.ts.

Note: GitHub should give you the option to squash this into one commit. If it doesn't, let me know and I'll do it.

TheFirstDeity avatar Sep 12 '16 14:09 TheFirstDeity

Is it possible to do this while keeping import from angular2-logger/core ? In the future there could be more than just the core module and the user might not want to import them all.

langley-agm avatar Sep 12 '16 14:09 langley-agm

Mmmm yes... But it requires the changes to the project layout that I did in the fork. We don't have to rename app to src, but the basic folder structure is specifically for the submodule behavior.

TheFirstDeity avatar Sep 12 '16 14:09 TheFirstDeity

It creates a lot of folder clutter, and I imagine bundling's going to be a nightmare because each submodule would need its own bundle...

Plus the user would have to know the name of each module's url. If the project is organized into NgModule classes, the user just has to remember the root directory. Intellisense can list all the NgModule classes referenced from the root index.ts when he goes to import from angular2-logger.

Edit: And come to think of it, I don't see how the es5 bundles would work automatically with multiple entry points. main can only point to one entry file. It works for es6 just because I have them compile into the root. I think someone using the es5 bundles would have to manually configure their module loader.

TheFirstDeity avatar Sep 12 '16 15:09 TheFirstDeity

By the way, I don't think my opinions are better. I'm fallible and I'm wrong all the time. I only know a bit about front-end development, and anything I say is based off my preferences.

I don't care what design decisions you choose. I just like solving puzzles when I can, so I might help.

TheFirstDeity avatar Sep 12 '16 21:09 TheFirstDeity