DEV Community

Cover image for Angular CLI + Meteor — No more ejecting Webpack Configuration
TheGuildBot for The Guild

Posted on • Updated on • Originally published at the-guild.dev

Angular CLI + Meteor — No more ejecting Webpack Configuration

This article was published on Friday, July 13, 2018 by Arda Tanrikulu @ The Guild Blog

Previously, we have to eject Webpack configuration generated by Angular CLI to modify module aliases
for Meteor's special import syntax such as meteor/meteor and meteor/mongo etc. However, this is
not required after the latest release of Meteor Client Bundler. Now, MCB can create stub modules for
these imports.

Quick Start

Check out the example in
angular-meteor.

How to Add Meteor Client to Your Existing Project

  • After installation of meteor-client-bundler:
yarn add meteor-client-bundler --dev
// or
npm install meteor-client-bundler --save-dev
Enter fullscreen mode Exit fullscreen mode
  • Add meteor-client.config.json with the necessary options:

```jsonc filename="meteor-client.config.json"
{
"runtime": {
"DDP_DEFAULT_CONNECTION_URL": "http://localhost:3000",
"ROOT_URL": "http://localhost:3000"
},
// This option enables the generation of stub modules
"generateNodeModules": true
}




*   After that, don't forget to add generated `meteor-client.js` to `angular.json`:



```json
{
  "scripts": ["node_modules/meteor-client.js"]
}
Enter fullscreen mode Exit fullscreen mode
  • Optionally, you can add postinstall script to generate all modules in every node_modules generation; because yarn or npm may remove your generated modules from this directory.

```json filename="package.json"
{
"scripts": {
"postinstall": "meteor-client bundle -s "
}
}




*   Ready to use!

Thank you for reading my blog post about using Angular CLI with new MCB. I'd appreciate your claps
to this post if you like it.

Enter fullscreen mode Exit fullscreen mode

Top comments (0)