[go: nahoru, domu]

Skip to content

Commit

Permalink
Use nwb for development tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
insin committed Jun 10, 2016
1 parent 83e90f3 commit 7d76115
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 230 deletions.
14 changes: 0 additions & 14 deletions .babelrc

This file was deleted.

40 changes: 0 additions & 40 deletions karma.conf.js

This file was deleted.

63 changes: 63 additions & 0 deletions nwb.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
var path = require('path')

var isDev = process.env.NODE_ENV === 'development'
var isTest = process.env.NODE_ENV === 'test'

var config = {
type: 'react-app',
babel: {
stage: 0,
loose: 'all'
},
webpack: {
define: {
__GAPI_KEY__: JSON.stringify('YOURAPIKEY')
},
html: {
mountId: 'root',
title: 'yelp-clone from fullstackreact.com (with nwb)'
},
loaders: {
css: {
modules: true,
localIdentName: (isDev ? '[path][name]__[local]__' : '') + '[hash:base64:5]'
}
},
postcss: [
require('precss'),
require('autoprefixer'),
require('cssnano')
],
extra: {
resolve: {
alias: {
containers: path.resolve('src/containers'),
components: path.resolve('src/components'),
utils: path.resolve('src/utils'),
styles: path.resolve('src/styles')
}
}
}
}
}

if (isTest) {
// Enable webpack compatibility tweaks
config.webpack.compat = {
enzyme: true,
sinon: true
}

// Tweak Karma config
config.karma = {
tests: 'tests.webpack.js',
plugins: [
require('karma-chai'),
require('karma-spec-reporter')
],
frameworks: ['mocha', 'chai'],
reporters: ['spec']
}
}

module.exports = config
43 changes: 7 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,32 @@
"version": "1.0.0",
"description": "",
"scripts": {
"start": "cross-env NODE_ENV=development hjs-dev-server",
"clean": "rimraf dist",
"build": "npm run clean && cross-env NODE_ENV=production webpack",
"start": "nwb serve src/app.js",
"clean": "nwb clean-app",
"build": "nwb build src/app.js",
"publish_pages": "gh-pages -d dist",
"ghpages": "npm run build && npm run publish_pages",
"test": "cross-env NODE_ENV=test karma start karma.conf.js",
"test:watch": "npm run test -- --watch"
"test": "nwb test",
"test:watch": "nwb test --server"
},
"author": "Ari Lerner <me@ari.io> (http://willcodeforfoo.com)",
"license": "ISC",
"devDependencies": {
"autoprefixer": "^6.3.6",
"babel-core": "^6.7.7",
"babel-loader": "^6.2.4",
"babel-plugin-transform-es2015-modules-umd": "^6.8.0",
"babel-polyfill": "^6.7.4",
"babel-preset-es2015": "^6.6.0",
"babel-preset-react": "^6.5.0",
"babel-preset-react-hmre": "^1.1.1",
"babel-preset-stage-0": "^6.5.0",
"babel-register": "^6.7.2",
"chai": "^3.5.0",
"chai-enzyme": "^0.4.2",
"cheerio": "^0.20.0",
"cross-env": "^1.0.8",
"css-loader": "^0.23.1",
"cssnano": "^3.5.2",
"dotenv": "^2.0.0",
"enzyme": "^2.2.0",
"expect": "^1.18.0",
"file-loader": "^0.8.5",
"gh-pages": "^0.11.0",
"hjs-webpack": "^8.1.0",
"jasmine-core": "^2.4.1",
"json-loader": "^0.5.4",
"karma": "^0.13.22",
"karma-chai": "^0.1.0",
"karma-jasmine": "^0.3.8",
"karma-mocha": "^1.0.1",
"karma-phantomjs-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-spec-reporter": "0.0.26",
"karma-webpack": "^1.7.0",
"mocha": "^2.4.5",
"phantomjs-polyfill": "0.0.2",
"phantomjs-prebuilt": "^2.1.7",
"nwb": "0.11.0",
"postcss-loader": "^0.9.1",
"precss": "^1.4.0",
"prettyjson": "^1.1.3",
"react-addons-test-utils": "^15.0.2",
"sinon": "^1.17.4",
"style-loader": "^0.13.1",
"url-loader": "^0.5.7",
"webpack": "^1.13.0",
"yargs": "^4.7.1"
"sinon": "^1.17.4"
},
"dependencies": {
"classnames": "^2.2.5",
Expand Down
2 changes: 1 addition & 1 deletion scripts/prepublish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
echo "=> Compiling..."
echo ""
rm -rf ./dist
NODE_ENV=production ./node_modules/.bin/webpack
./node_modules/.bin/nwb build
echo ""
echo "=> Complete"
3 changes: 0 additions & 3 deletions tests.webpack.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require('babel-polyfill');
// some setup first

var chai = require('chai');
var chaiEnzyme = require('chai-enzyme');

Expand Down
136 changes: 0 additions & 136 deletions webpack.config.js

This file was deleted.

0 comments on commit 7d76115

Please sign in to comment.