A quick & dirty sample project demonstrating use of Webpack2 as the client bundler on an Angular-Meteor project, specifically the Angular2-Meteor Boilerplate, using Meteor Client Bundler to bundle Meteor Atmosphere packages for use outside of Meteor Isobuild. For demonstration purposes only.
- node.js
- MeteorJS
After downloading:
npm install
To launch:
npm run start
Open a browser to http://localhost:8080/
> npm run start- Run the Meteor application, served by webpack-dev-server at http://localhost:8080/.> npm run meteor.reset- Resets Meteor's cache and clears the MongoDB collections.> npm run meteor.runRuns only the Meteor server> npm run webpack.devRuns only the Angular-Meteor client viawebpack-dev-server> npm run meteor.client-bundleRunsmeteor-client-bundler, needed when new client Atmosphere packages added`
How this project was made:
- In a privileged command prompt:
git clone https://github.com/bsliran/angular2-meteor-base Angular-Meteor-Webpack
cd Angular-Meteor-Webpack
meteor add mongo
npm install
npm install --global meteor-client-bundler
mkdir meteor
move .meteor meteor\.meteor
move server meteor\server
mklink /d meteor\both both
mklink /d meteor\node_modules node_modules
mklink meteor\typings.d.ts typings.d.ts
mklink meteor\package.json package.json
- Added
meteor-client.config.json:
{
"import": [
"meteor-base",
"mongo",
"reactive-var",
"tracker",
"es5-shim",
"autopublish",
"insecure"
]
}- Bundled Atmosphere packages for loading via Webpack:
meteor-client bundle
- Modified
client\main.tsaddingimport 'meteor-client';to add bundled Meteor Atmosphere packages - Modified
tsconfig.jsonadding"meteor/**/*"toexcludearray - Hacked together
webpack.config.jsbased on - Modified
package.jsondependencies&devDependenciesvianpm installto add Webpack development dependencies used inwebpack.config.js - Modified
package.jsonscriptsto function in new configuration