Live data from Hacker News

Getting Started with Webpack 2

blog.madewithenvy.com

31–40 of 59 posts

Re: Getting Started with Webpack 2

#32
post #4

Interestingly, things seem to be settling down in the JS community. In the past, every time a library lacked a particular feature, the community suddenly abandoned it. At the same time, every new version release had all sorts of horrible breaking changes, that made upgrading a very scary task. Now, the JS community seems to be thinking more about stability and backwards compatibility. That's very welcome, at least fr…

>> Interestingly, things seem to be settling down in the JS community.

As a front-end dev, to me it seems to be zipping along at the same, old faster-than-it-should pace it has for the past few years. Depends on perspective I guess.

Re: Getting Started with Webpack 2

#33
post #9

I currently use gulp and, over the yars, have found many ways to do my own parsing and smart caching and stuff over, like checking and bumping version numbers, conditional compiling, caching assets etc. I'd hate to loose all that, but I do see the advantages of Webpack. How much control do I have with Webpack though? Can I still write my own hooks?

That's my concern as well, I use browserify and a simple bash script to do some clever stuff I couldn't reliably do with Grunt, I'd hate to lose the flexibility.

You won't lose any flexibility. See link above regarding plugins.

Re: Getting Started with Webpack 2

#34
post #4

Interestingly, things seem to be settling down in the JS community. In the past, every time a library lacked a particular feature, the community suddenly abandoned it. At the same time, every new version release had all sorts of horrible breaking changes, that made upgrading a very scary task. Now, the JS community seems to be thinking more about stability and backwards compatibility. That's very welcome, at least fr…

I'm still skeptical. Webpack is one of the saner ones. Many JS libraries are still doing break-everything major version releases- Babel and Angular come to mind.

Re: Getting Started with Webpack 2

#35
post #20

Webpack 2 is so awesome that I'm really confused why haven't they released it as a non-beta yet. It's way past MVP and has more than enough quality for a non-beta. It looks like the maintainers want it to get perfect and release it "when it's done", and that is so wrong.

Well, I think it's commendable and shows how much they care about their work. Caution and deliberation seem to be lost virtues in most of the JS universe. Take as much time as you need, Webpack team!

Re: Getting Started with Webpack 2

#36
post #4

Interestingly, things seem to be settling down in the JS community. In the past, every time a library lacked a particular feature, the community suddenly abandoned it. At the same time, every new version release had all sorts of horrible breaking changes, that made upgrading a very scary task. Now, the JS community seems to be thinking more about stability and backwards compatibility. That's very welcome, at least fr…

yeah, we're very much building on top now. There's still a few competing options for everything (and that's a good thing! You need SOME competition to ensure nothing stagnates), but we're mostly done redoing everything from scratch.

There's still a little churn in the framework and state management world, but the existing options are more than good enough for years to come and nothing drastically different is popping up into the spotlight anymore.

Re: Getting Started with Webpack 2

#37
post #9

I currently use gulp and, over the yars, have found many ways to do my own parsing and smart caching and stuff over, like checking and bumping version numbers, conditional compiling, caching assets etc. I'd hate to loose all that, but I do see the advantages of Webpack. How much control do I have with Webpack though? Can I still write my own hooks?

The vast majority of anything you'll ever need, even in absurdly complex scenarios, are built in.

If you need to do something really wild and weird, the plugin and loader architecture will let you do pretty much anything and hook into nearly everything.

We're dealing with a legacy environment here and we have a suite of plugins and loaders to handle non-standard module types, deal with files pulled from CDN at build time, deal with legacy Rails-style script imports, plugins to do all sort of bundle validation, splitting, transforming...really anything goes.

Re: Getting Started with Webpack 2

#38
post #8

Semi-related: I also found it useful to name the config file webpack.config.babel.js instead of webpack.config.js so I can use ES6 in my Webpack config.

No longer really needed. Node 6.X and 7 support pretty much all of ES6 minus imports. Using require instead of import is a very small price to pay to get fast startup time. You can use everything else ES6.

Re: Getting Started with Webpack 2

#39
post #9

I currently use gulp and, over the yars, have found many ways to do my own parsing and smart caching and stuff over, like checking and bumping version numbers, conditional compiling, caching assets etc. I'd hate to loose all that, but I do see the advantages of Webpack. How much control do I have with Webpack though? Can I still write my own hooks?

The thing is Webpack does all generally needed web building stuff out of the box and there are plugins and addition loaders. You can define needed behavior in a kind of way having no need dealing with Gulp mess. I used Gulp before, then switched to the Webpack and have already switched a few projects to the Webpack v2. Webpack is a gulp of fresh air, much convenient than Gulp or similar stuff using which you will have to write your own framework.

Re: Getting Started with Webpack 2

#40
post #7
post #2

What is the difference from Webpack 1? This tutorial seems identical to every other Webpack getting started I've read.

I think the biggest addition is ES2015 modules. Webpack now understands them without the need to convert them to commonjs/amd. import works statically (before the JS is run), which allows webpack to make some optimizations. (System.import() is used for dynamic (runtime) imports)

There is also a config validation, which is a good thing.
Post reply on HN