Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Upgrade to webpack@2 #421

Closed
MoOx opened this issue Apr 27, 2016 · 14 comments
Closed

Upgrade to webpack@2 #421

MoOx opened this issue Apr 27, 2016 · 14 comments
Assignees

Comments

@MoOx
Copy link
Owner

MoOx commented Apr 27, 2016

I am currently trying it on a project and there is not a lot of breaking changes, so should not be a big deal.
Still flagged as beta, but for a while so I think it's pretty mature now.

@thangngoc89
Copy link
Contributor

thangngoc89 commented Sep 1, 2016

I think webpack 2 is stable enough to be used in phenomic. I use it in several projects right now.

I read somewhere that webpack's team is focused on making the documentation better atm. And working on the next version.

@MoOx
Copy link
Owner Author

MoOx commented Sep 1, 2016

Same here, using v2 for a while now.

Indeed they works on the doc to remove "beta" flag :)

@thangngoc89
Copy link
Contributor

I gave this a try and find out that, because of the mix between node and webpack environment, we can't disable commonjs module transformation in babel :/ . Any suggestions?

@MoOx
Copy link
Owner Author

MoOx commented Sep 5, 2016

We might disable it for client build, not node build. Not possible?

@thangngoc89
Copy link
Contributor

AFAIK, It's not possible (or I'm overthinking).

@MoOx
Copy link
Owner Author

MoOx commented Sep 5, 2016

We are talking about disabling/enabling a specific babel plugin depending on the env right?

@thangngoc89
Copy link
Contributor

I give this another try tonight.

@MoOx
Copy link
Owner Author

MoOx commented Sep 5, 2016

Will try too. I won't cut a new release until this is done anyway, since #714 sucks!

@MoOx MoOx added the wip label Sep 5, 2016
@MoOx MoOx self-assigned this Sep 6, 2016
@MoOx
Copy link
Owner Author

MoOx commented Sep 6, 2016

On it.

@MoOx
Copy link
Owner Author

MoOx commented Sep 7, 2016

OK it was alsmost easy until you want to disable es2015 modules for webpack only :)

@MoOx
Copy link
Owner Author

MoOx commented Sep 7, 2016

Now the tricky part is react-hot-loader update :)

@thangngoc89
Copy link
Contributor

👍

MoOx added a commit that referenced this issue Sep 8, 2016
You now must use webpack 2.
Don’t worry if it’s still tagged beta, it won’t it already usable for
months
and will be tagged as stable really soon.
This will mainly improve performance & size of the bundle
(which increased in recent version) thank to the
[tree shaking feature
](http://blog.sethladd.com/2013/01/minification-is-not-enough-you-need.h
tml).
You  might need to update some babel packages to latest version
(especially babel-preset-es2015, to get the `modules` option).

You will need to:

- add new sections in your ``babel.env`` configuration.
webpack 2 understand natively ``import``statements so it’s
unnecessary to
transform those (and it will allow webpack 2 enable tree shaking):
``webpack-develompment`` & ``webpack-production``.
Check out this commit for detail
(or take a look to the up to date boilerplate).
- disable ``webpack.optimize.DedupePlugin`` as it’s not working yet in
webpack 2
- update ``ExtractTextPlugin`` usage

Closes #421
MoOx added a commit that referenced this issue Sep 8, 2016
@thangngoc89
Copy link
Contributor

Tracking this mzgoddard/hard-source-webpack-plugin#27

MoOx added a commit that referenced this issue Sep 8, 2016
@MoOx MoOx removed the wip label Sep 8, 2016
@MoOx
Copy link
Owner Author

MoOx commented Sep 8, 2016

Closing in favor of #737

@MoOx MoOx closed this as completed Sep 8, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants