Building Blaze with webpack

My team and I are in the process of migrating from Meteor-Blaze to Meteor-React, and we’re looking to gain more control over our build process for a few reasons. Namely that there currently isn’t enough configuration options available for typescript as tsconfig is ignored by meteor-typescript, the third party TS builder is agonizingly slow, and we’d like to utilize some sort of tree-shaking as our app bundle is becoming rather large.

Has anybody had any luck building meteor-blaze with web-pack / would it be possible? Ive seen meteor-webpack but it looks like its only able to work with react only, and we still have a large amount of code in blaze.

1 Like

yessir - I wrote a set of npm packages to do just this:

  1. https://www.npmjs.com/package/meteor-blaze-compiler
  2. https://www.npmjs.com/package/meteor-blaze-runtime
1 Like

@znewsham. Nice! Is there an example project somewhere that shows how you use these packages with webpack?

There’s an example here: https://bitbucket.org/znewsham/meteor-blaze/src/master/webpack-project/

1 Like

Coming back to this after a bit, I had tried extensively to get your blaze compiler to work with my complex Meteor/Blaze/React project, but unfortunately got nowhere, i can come back to it in a bit to recall exactly what errors i ran into. But it seems from a first glance that this is just aimed at blaze and not building an entire meteor app, am i correct?

I’m not sure how well it would work when mixed with react, I assumed you would be moving away from meteor to use webpack for everything. You can use this with a meteor project by using the included meteor package, but it is quite hacky. Lots of packages implicitly depend on blaze but don’t list them in their deps, and blaze itself requires several packages to function. Long story short if you’re still using meteor, use the regular meteor blaze package. I’m not even sure how you’d go about building out all the rest of a meteor application with webpack.

Hi,

I have seen the repo, Can you please guide me how to run this in development mode & also, can we use Minimongo along with it?

As this package is totally separate from meteor, you can only use packages that are available as NPM modules. If minimongo is available, then you should be able to use it.

Regarding running it, have you tried running the example project? I don’t generally work with webpack - the setup there was just an example.

Yes I have tried webpack-project, but not sure how to use this project for further development

Hi,

Is there any way I could use Meteor/Mongo for doing Mini Mongo Operations in the standalone webpack module?

I managed to convert minimongo to an NPM package, it might help in your case

Thanks for this. Can you update the documentation please, I need to know what am I supposed to write to import this.

Thanks again.

1 Like

@harry97 Please let me know how can I import now as of now if possible?

Hello,

Does this package provide reactivity? I have tried it but its only adds in Mini mongo, whenever I want to retrieve the data using the helper function, getting a blank array.