Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch over to Webpack from Browserify #6

Merged
merged 7 commits into from
Mar 14, 2015
Merged

Switch over to Webpack from Browserify #6

merged 7 commits into from
Mar 14, 2015

Conversation

pheuter
Copy link
Owner

@pheuter pheuter commented Mar 12, 2015

Pretty straightforward idea, see #3 for more info.

TODO:

  • Add Webpack and related dependencies
  • Remove no longer needed dependencies
  • Ensure watch and build scripts work
  • Setup headless unit testing and ensure test script works
  • Code coverage
  • React Hot Loader

Let me know what you guys think, would like to get the community's opinion on best practices with Webpack while still maintaining the simplicity of the skeleton.

- Replaced Browserify dependencies with Webpack
- Removed no longer necessary file extensions
- Refactored npm scripts to call webpack (interface remains the same!)
- Implemented karma test runner with mocha unit tests and code coverage
- Removed non-"essential" libraries such as es5-shim and console-polyfill (can be added back easily)
- Updated package.json with revised run scripts (no major changes)
- Updated test files to no longer include extension
- Updated README with latest info
@pheuter pheuter added this to the v0.2.0 milestone Mar 12, 2015
@coveralls
Copy link

Coverage Status

Coverage decreased (-10.83%) to 73.91% when pulling 94ffdf9 on webpack into d2a1ca9 on master.

@pheuter
Copy link
Owner Author

pheuter commented Mar 12, 2015

The coverage has decreased slightly due to the switch in tooling and different methods of determining code coverage. I believe the new, lower score is more accurate, so I guess that's a good thing :P

@coveralls
Copy link

Coverage Status

Coverage decreased (-2.14%) to 82.61% when pulling 5349af5 on webpack into d2a1ca9 on master.

@zspecza
Copy link

zspecza commented Mar 14, 2015

You could perhaps use environment variables to differ between dev/production environments and use WebPack / Express servers respectively:

var PORT = process.env['PORT'] || 3000;

if (process.env['NODE_ENV'] === 'development') {
  var webpack = require('webpack');
  var WebpackDevServer = require('webpack-dev-server');
  var config = require('./webpack.config');

  var server = new WebpackDevServer(webpack(config), {
    publicPath: config.output.publicPath,
    hot: true,
    historyApiFallback: true
  });

  server.listen(PORT, 'localhost', function (err, result) {
    if (err) console.log(err);
    console.log('Listening at %s:%s', server.address.host, server.address.port);
  });
} else {
  var express = require('express');
  ...
}

- Removed no longer needed 'xhr' dependency
- Replaced expect.js with sinon and chai
- Added unit test for request#getData() with mocking:
@pheuter
Copy link
Owner Author

pheuter commented Mar 14, 2015

@declandewet interesting, also looks like the docs have some info to combine the two servers side-by-side. will take a look

@coveralls
Copy link

Coverage Status

Coverage increased (+6.04%) to 90.79% when pulling a8a1064 on webpack into d2a1ca9 on master.

@pheuter pheuter removed the question label Mar 14, 2015
- Split webpack config into local and production
- Removed no longer necessary run scripts
- Extra documentation of webpack config
@pheuter pheuter mentioned this pull request Mar 14, 2015
@coveralls
Copy link

Coverage Status

Coverage increased (+6.04%) to 90.79% when pulling 18ebe11 on webpack into d2a1ca9 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+6.04%) to 90.79% when pulling f9ed97d on webpack into d2a1ca9 on master.

@pheuter pheuter removed the WIP label Mar 14, 2015
pheuter added a commit that referenced this pull request Mar 14, 2015
Switch over to Webpack from Browserify
@pheuter pheuter merged commit 2a929fc into master Mar 14, 2015
@pheuter pheuter deleted the webpack branch March 14, 2015 17:57
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.

None yet

3 participants