diff --git a/.gitignore b/.gitignore index a8f1560..4899342 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ node_modules/ -build/ data/ dist/ +bundle.js diff --git a/example/index.html b/example/index.html index 0e1f0d9..a032fd0 100644 --- a/example/index.html +++ b/example/index.html @@ -6,6 +6,6 @@
- + diff --git a/example/webpack.config.js b/example/webpack.config.js index 3a2556a..d8de575 100644 --- a/example/webpack.config.js +++ b/example/webpack.config.js @@ -3,8 +3,8 @@ var path = require('path') module.exports = { entry: path.resolve('example/index.js'), output: { - path: path.resolve('build'), - filename: 'example.js', + path: path.resolve('example'), + filename: 'bundle.js', }, module: { diff --git a/package.json b/package.json index 0742369..8db6f78 100644 --- a/package.json +++ b/package.json @@ -42,11 +42,13 @@ "webpack": "1.12.14" }, "scripts": { - "clean": "rimraf build/ data/ dist/", + "clean": "rimraf data/ dist/", "build:data": "node scripts/build-data", "build:example": "node scripts/build-example", "build:dist": "node scripts/build-dist", - "build": "npm run build:data && npm run build:dist", + "build": "npm run build:data && npm run build:example && npm run build:dist", + "watch:example": "node scripts/watch-example", + "watch": "npm run watch:example", "react:clean": "rimraf node_modules/{react,react-dom,react-addons-test-utils}", "react:14": "npm run react:clean && npm i react@^0.14 react-dom@^0.14 react-addons-test-utils@^0.14 --save-dev", "react:15": "npm run react:clean && npm i react@^15 react-dom@^15 react-addons-test-utils@^15 --save-dev", diff --git a/scripts/build-example.js b/scripts/build-example.js index 0b07f58..b64f772 100644 --- a/scripts/build-example.js +++ b/scripts/build-example.js @@ -1,10 +1,8 @@ var path = require('path') var webpack = require('webpack') +var config = require('../example/webpack.config.js') -var config = require('../example/webpack.config.js'), - compiler = webpack(config) - -compiler.watch({}, (err, stats) => { +webpack(config, (err, stats) => { if (err) throw err console.log( diff --git a/scripts/watch-example.js b/scripts/watch-example.js new file mode 100644 index 0000000..0b07f58 --- /dev/null +++ b/scripts/watch-example.js @@ -0,0 +1,28 @@ +var path = require('path') +var webpack = require('webpack') + +var config = require('../example/webpack.config.js'), + compiler = webpack(config) + +compiler.watch({}, (err, stats) => { + if (err) throw err + + console.log( + stats.toString({ + colors: true, + hash: true, + version: false, + timings: true, + assets: true, + chunks: false, + chunkModules: false, + modules: false, + children: false, + cached: false, + reasons: false, + source: false, + errorDetails: false, + chunkOrigins: false, + }) + ) +})