Registry / http-networking / meteor-client-bundler

meteor-client-bundler

JSON →
library0.6.0jsnpmunverified

A CLI tool and module bundler that combines Meteor Atmosphere packages into a single JavaScript module for use outside of the full Meteor platform. Version 0.6.0 is the latest stable release (last release in 2018). It uses the Meteor command-line tool to resolve and bundle packages, producing a standalone file that provides Meteor's client-side API (including DDP). Key differentiator: it enables frameworks like Angular CLI, React Native, or Ionic to use Meteor's real-time data features without running a Meteor server. Compared to alternatives like `ddp-client`, this bundles full Meteor client runtime including accounts and file upload packages.

npm install meteor-client-bundler
INSTALL
IMPORT
SIG · METEOR-CLIENT-BUND
M
meteor-client-bundler
http-networkingjavascriptv0.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Meteor
import { Meteor } from 'meteor-client'
import Meteor from 'meteor-client'
The bundled module exports Meteor as a named export, not a default export.
Accounts
import { Accounts } from 'meteor-client'
const Accounts = require('meteor-client').Accounts
Available only if accounts-base is included in the bundle.
Mongo
import { Mongo } from 'meteor-client'
Also exports other Meteor globals like Random, EJSON, etc.
require('meteor-client')
const MeteorClient = require('meteor-client'); const { Meteor } = MeteorClient;
const meteor = require('meteor-client'); // returns an object, not a function
CommonJS usage – destructure named exports from the required object.

Shows installation, configuration, bundling with meteor-client-bundler, and client usage with Meteor.connect and Meteor.call.

// Install meteor-client globally npm install -g meteor-client-bundler # Create a config file meteor-client.config.json { "release": "1.9", "runtime": { "DDP_DEFAULT_CONNECTION_URL": "http://localhost:3000" }, "import": ["meteor-base"] } # Run bundler meteor-client bundle --destination meteor-bundle.js # In your app import { Meteor } from './meteor-bundle'; Meteor.connect('http://localhost:3000'); Meteor.call('myMethod', (err, res) => { if (err) console.error(err); else console.log(res); });
meteor-client-bundler --version
Debug
Known issues
breakingThe module exports have changed in v0.6.0: Meteor is now an ES module named export, not a default export.
fix
Change `import Meteor from 'meteor-client'` to `import { Meteor } from 'meteor-client'`
affects: >=0.6.0
gotchaThe bundler requires the Meteor CLI tool to be installed globally; without it, `meteor-client bundle` will fail.
fix
Install Meteor: `curl https://install.meteor.com/ | sh`
affects: >=0.0.0
deprecatedThe `--url` command-line option is deprecated in favor of the `runtime.DDP_DEFAULT_CONNECTION_URL` config field.
fix
Use `"runtime": { "DDP_DEFAULT_CONNECTION_URL": "..." }` in the config file
affects: >=0.0.0
gotchaThe bundled module does not work in browser environments that do not support ES modules natively.
fix
Use a bundler like webpack or rollup to transform the output, or set the output to CommonJS via the config (not documented).
affects: >=0.6.0
Errors
Common errors & fixes
Error: Can't resolve 'meteor-client'
The module is not installed or the import path is incorrect.
fix
Ensure you have run `meteor-client bundle` and the output file path matches your import. For example, if bundled to `meteor-bundle.js`, import from './meteor-bundle'.
Meteor is not defined
Using the module before calling Meteor.connect or not importing correctly.
fix
Call `import { Meteor } from 'meteor-client'; Meteor.connect('...');` and ensure the connection URL is reachable.
Error: The package 'meteor-base' was not found in the Meteor universe
The specified Meteor release does not include the required packages or the release is not installed.
fix
Check the `release` field in config; ensure Meteor is installed and the release exists. Use `meteor update` to fetch releases.
Upgrade
Version history
0.6.0latest on npm
Audit
Dependencies
meteorrequiredRequires the Meteor CLI tool to be installed globally for bundling packages
meteor-client.config.jsonoptionalConfiguration file in the project root for bundler options
Agent activity
5 hits · last 30 days
node
4
Bingbot
1
Resources
meteor-client-bundler — npm install meteor-client-bundler · libregistry