tomitrescak / Meteor-Boilerplate-Webpack-Mantra-Typescript

Meteor boilerplate for mantra applications, supporting webpack, mantra and typescript
17 stars 3 forks source link

Pros and cons of using webpack with Meteor / mantra #1

Open tonyxiao opened 8 years ago

tonyxiao commented 8 years ago

This is a follow up to the original issue on https://github.com/kadirahq/mantra/issues/34

arunoda doesn't seem that webpack has anything to do with mantra right now since we have meteor's build system. @tomitrescak could you explain a little bit of where you see this project fit in, and why one may or may not desire to use webpack with Meteor and Mantra?

tomitrescak commented 8 years ago

Tony, just check out the project page of the Webpack Kickstarter project. You get all the perks of using Webpack and react such as hot code reload and native module support. There is much more. From my part I really like the hot code reload and the module support which is still not ideal in Meteor 1.3. Also I enjoy the development in Typescript and using different loaders and Babel plugins such as the one for jsx controls (if\for)

tonyxiao commented 8 years ago

This is cool. Are there any downsides to this vs. using the mantra at kadirahq/mantra? Just read https://github.com/thereactivestack/meteor-webpack is not compatible with ecmascript package since webpack takes care of it.

tomitrescak commented 8 years ago

Well, the idea is to use native npm packages and es2105 via Babel and as a result you do not depend on meteor packages, which .... repackage native Libs and often become outdated.

Honestly, I stopped using native meteor and develop everything on Webpack now. It's too good. Also, if you use mantra essentially you will become more agnostic to all used frameworks and able to substitute in the future. All my 10+ projects run on Webpack ... And am slowly switching to mantra.

tonyxiao commented 8 years ago

Got it. does this work with meteor 1.3?

tomitrescak commented 8 years ago

Not yet ... but @exon promised some major improvements when 1.3 will come ;) 1.3 is not needed for now.

vonwao commented 8 years ago

this is interesting. There is one advantage I see in meteor, is being able to have some "global" variables, not having to import in every single file (I think this is what the "imports" directory in 1.3 is for). I wonder with webpack if that's possible...

eXon commented 8 years ago

@vonwao Yes you can do the same thing by using the global variable.

global.MyGlobalVariable = `I'm everywhere!`;