I’ve seen a few ways of dealing with Angular client dependencies on Atmosphere packages in Angular-Meteor projects, including:
- Foregoing the use of
import
statements for Atmosphere packages by making Meteor typings ambient in the project by placing in/// <reference types="@types/meteor" />
in atypings.d.ts
TypeScript declarations file or adding"types": ["meteor"]
totsconfig.app.json
(as is done by the Angular-Meteor Angular CLI example project) - Using WebPack directly (either from scratch or ejected from Angular CLI) and using a custom externals resolver function in to allow standard TypeScript imports of Meteor Atmosphere packages (as is done in the Angular-Meteor Ionic tutorial application).
With the introduction of Angular CLI builders in Angular CLI 6, it occurs to me that it may be possible to forego making Meteor types ambient and still use Angular CLI by merging in a custom Webpack externals configuration.
I’ve attempted this setup by adding the angular-cli-builders as a project dependency, adding them to angular.json
, and creating an extra-webpack.config.js
but thus far have not been able to create a working configuration. Has anyone successfully attempted this setup?