# meteor-webpack-client

> Use Meteor's native client packages in a non Meteor project

Latest version **0.9.1** (published 2016-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install meteor-webpack-client
pnpm add meteor-webpack-client
yarn add meteor-webpack-client
bun add meteor-webpack-client
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.1 |
| Published | 2016-10-14 |
| First published | 2016-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Stéphane Denis |
| Maintainers | stphdenis |
| Keywords | meteor, webpack |

## Links

- npm: https://www.npmjs.com/package/meteor-webpack-client
- Repository: https://github.com/stphdenis/meteor-webpack-client
- Homepage: https://github.com/stphdenis/meteor-webpack-client#readme
- Issues: https://github.com/stphdenis/meteor-webpack-client/issues
- npm.io page: https://npm.io/package/meteor-webpack-client

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.9.1 (latest) — 2016-10-14
- 0.9.0 — 2016-10-14
- 0.0.1 — 2016-10-13

## README

# meteor-webpack-client
Use Meteor's native client packages in a non Meteor project.

The packages are from a local meteor install of any version whith their css files.

### Installation

#### NPM
From your non-meteor client :
`npm install --save meteor-webpack-client`

### Usage

#### 1. Meteor setup :
Install all packages you need in meteor and run it one time to refresh the client side.

#### 2. Client setup (webpack client, not the client side of meteor) :

To define `__meteor_runtime_config__` global variable you have to make a `meteor-runtime-config.js` file in your root.
The following is the default if empty :
```js
export const __meteor_runtime_config__ = {
  meteorEnv: {},
  DDP_DEFAULT_CONNECTION_URL: 'http://localhost:3000',
  PUBLIC_SETTINGS: {
    __global_scope__: true
  }
};
```
* Set DDP connection url with `DDP_DEFAULT_CONNECTION_URL` if using DDP
* Make Meteor objects global with `__global_scope__: true`; you still have to import your package in your main. Ex: `import 'meteor/accounts-base'` to have `Accounts`.

#### 3. easy-webpack configuration :

   This package is to be used with easy-webpack. You have to add the following code to your `webpack.config.js` :
```js
config = generateConfig(
  config,
  require('meteor-webpack-client')()
);
```

You can add options :
- `meteorPath`: where meteor is installed (can be absolute or relative),
- `meteorLibsPath`: where meteor adapters will be written (can be absolute or relative),
- `exclude`: a list of modules to be excluded from the bundle.

The following example show the options by default :
```js
require('meteor-webpack-client')({
  meteorPath: '../server',
  meteorLibsPath: './.meteor-libs',
  exclude: [
    'autoupdate',
    'global-imports',
    'hot-code-push',
    'reload',
    'ecmascript'
  ]
})
```

   It makes it possible to import the packages as in Meteor 1.3+ :
```js
import { Meteor } from 'meteor/meteor';
import { DDP } from 'meteor/ddp';
```

The packages bundled by webpack are only those imported by your code with their dependencies.

All css files bundled by meteor are bundled by webpack.

### What I've done
The code is in the native compiled version of Meteor for a given version.

I wanted to be able to use meteor's modules with webpack using `import {...} from 'meteor/...'` and working with Aurelia.

---
_Source: https://npm.io/package/meteor-webpack-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
