Skip to content

Conversation

@nawatts
Copy link
Contributor

@nawatts nawatts commented Mar 2, 2017

Grunt watching for changes and running Babel and Require.js was taking ~10s to rebuild after saving a change. With webpack watching for changes, it takes ~0.1-0.5s. This does require an updated Node. I used the 6.10.0 LTS version for development.

import ScatterGraph from './views/ScatterGraph';
import TrendLine from './views/TrendLine';
import AreaGraph from './views/AreaGraph';

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets built for consumption as an ES6 module, so this style of export is necessary to have Nugget.Events instead of Nugget.default.Events.

lib : 'lib',
build : 'build',
dependencies : 'dependencies',
release : 'release',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, Babel would output into build and then that file would be wrapped in an AMD definition and put in release. Now, webpack builds a UMD library, no intermediate step required.

"start": "concurrently --kill-others \"webpack --watch\" \"grunt development\"",
"test": "open http://localhost:9000/_SpecRunner.html"
},
"devDependencies": {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated packages as far as they could go, but grunt-template-jasmine-requirejs isn't maintained any more and doesn't work with Grunt 1.0.0

@nawatts nawatts force-pushed the nw_webpack branch 2 times, most recently from b4e4ccc to bf79113 Compare March 2, 2017 22:40
Copy link

@rcreasi rcreasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most excellent! I'm all about the DX and this is a significant enhancement.

@choochburger
Copy link
Contributor

This looks super awesome! 👍 Taking it for a quick spin

@choochburger
Copy link
Contributor

Ahhh so I was wondering how you pulled this off with our ancient version of Node 😄 Looks like this needs an updated version? I tried it with node-env running v7.4 and it works great, but it blows up pretty spectacularly with old Node 💥 I'm fine using node-env for Nugget work if everyone else is 👍 We'll hopefully be getting Node out of the server mix soon anyway, and then the version won't matter much.

One thing I noticed is that we'll need to update our main app Gruntfile refs from /release --> /build so that the lib gets copied over when changes occur.

Thanks for taking this on, it's seriously awesome!

@choochburger
Copy link
Contributor

@nawatts is this ready to rock now that we've ditched old node?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants