Add webpack to your meteor project — the simple way

A simple way to add webpack to your meteor project: https://medium.com/@htalebi/add-webpack-to-you-meteor-project-the-simple-way-52a55248de65#.2gxbs5vce

2 Likes

This is a great alternative for using Browserify! However, you might want to add to your repo readme that you need to npm run build before it works (otherwise UpperCase is undefined).

Also you may want to add that this won’t allow you to use ES6 modules in your meteor code.

1 Like

@SkinnyGeek1010 what package or solution do you think is best for use webpack and retain all meteor functionality for apps that merge blaze and react code.
If MDG don´t improve rebuild time on version 1.3, is this approach: https://github.com/mindfront/webpack-meteor-tools the way to follow?

I wanted this to work with FlowRouter and ReactLayout, but it apparently doesn’t for some reason.

I get this error:

There is no route for the path: /

And my router is simply:

FlowRouter.route('/', {
  name: 'home',
  action() {
    ReactLayout.render(Layout, {content: <Home />});
  }
});

What am I missing?

Nice. Add it to my own project but did not watch obvious improvement vs meteor. Just use your UpperCase example.

@bysabi i’m using the jedwards/meteor-webpack-react project because it’s the most decoupled from Meteor. It’s not as simple but once it’s setup you mostly dont have to touch it.

1 Like

@SkinnyGeek1010 it seem´s that @jedwards don´t active work in this project: https://github.com/jedwards1211/meteor-webpack-react/issues/117 and recommend use this: https://github.com/mindfront/webpack-meteor-tools but I can´t not found any example base on it.
Do you test it?

It’s still active but I don’t think it really needs more improvement. They added a lot of things like windows support which broke a few commits on master. If the latest master doesn’t work pinging him for the latest stable would be good.

I’m using the commit very close to the one in my screencast. I think a few later fixed a couple issues for edge cases but it’s been super stable for me. The last one I remember using was when my deploy script got merged in.

Basically i’d be ok writing a webpack config for myself now (after dealing with it slowly) so even if he does abandon it, it’s still just webpack so the webpack ecosystem is at your disposal.

I think his meteor-tools started out to be a meteor package but I dont’ think it was finished after the other webpack project came out.

Also the webpack version in the original post will replace browserify which is a bottleneck in the build process.

to what “sceencast” do you refer?

1 Like

Ah, sorry I was referring to the one in this thread: