fix stuff and add webpack-validator

This commit is contained in:
Kent C. Dodds 2016-05-04 15:19:24 -06:00
parent 92150d0176
commit 1645860dc5
5 changed files with 26 additions and 4 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules
coverage/
dist
.opt-in

View File

@ -1,4 +1,4 @@
const webpackConfig = require('./webpack.config.babel')
const webpackConfig = require('./webpack.config')
require('babel-register')
module.exports = function setKarmaConfig(config) {

View File

@ -18,6 +18,7 @@
"eslint": "2.9.0",
"eslint-config-kentcdodds": "6.2.1",
"eslint-loader": "1.3.0",
"ghooks": "1.2.1",
"jasmine-core": "2.4.1",
"karma": "0.13.22",
"karma-chrome-launcher": "1.0.1",
@ -25,14 +26,24 @@
"karma-firefox-launcher": "0.1.7",
"karma-jasmine": "0.3.8",
"karma-webpack": "1.7.0",
"npm-run-all": "1.8.0",
"opt-cli": "1.4.2",
"rimraf": "2.5.2",
"style-loader": "0.13.1",
"webpack": "2.1.0-beta.6",
"webpack-dev-server": "2.0.0-beta"
"webpack-dev-server": "2.0.0-beta",
"webpack-validator": "1.4.0"
},
"config": {
"ghooks": {
"pre-commit": "opt --in pre-commit --exec \"npm run validate\""
}
},
"scripts": {
"test": "cross-env NODE_ENV=test karma start",
"watch:test": "cross-env NODE_ENV=test karma start --auto-watch --no-single-run",
"validate": "npm-run-all --parallel validate-webpack lint test",
"validate-webpack": "webpack-validator webpack.config.js",
"clean-dist": "rimraf dist",
"copy-files": "cpy src/index.html src/favicon.ico dist",
"clean-and-copy": "npm run clean-dist && npm run copy-files",

View File

@ -2,8 +2,18 @@
**This particular example has been migrated to utilize ES6**
This is part of [an ES6 training](bit.ly/es6-intro-slides) by [Kent C. Dodds](https://twitter.com/kentcdodds)
This was originally part of [an ES6 training](bit.ly/es6-intro-slides) by [Kent C. Dodds](https://twitter.com/kentcdodds)
Now I'm using it to teach people about [Webpack](http://webpack.github.io/).
> JavaScript® (often shortened to JS) is a lightweight, interpreted, object-oriented language with first-class functions, most known as the scripting language for Web pages, but used in many non-browser environments as well such as node.js or Apache CouchDB.
> _[JavaScript - developer.mozilla.org](http://developer.mozilla.org/en-US/docs/JavaScript)
## Project Setup
1. Fork the GitHub Repo
2. Clone your Fork
3. Run `npm install`
4. Run `npm run validate`
5. If everything's running without errors, you can start checking out the available branches (`git remote show origin`)

View File

@ -1,4 +1,4 @@
import Controller from '../js/controller'
import Controller from '../src/js/controller'
describe('controller', () => {
var subject, model, view