Build example in `example/bundle.js`
- Add watch script - Make `npm run build` builds the example so that it’s included on npmrelease
parent
f01ad53b6f
commit
ecf3784d32
|
@ -1,4 +1,4 @@
|
|||
node_modules/
|
||||
build/
|
||||
data/
|
||||
dist/
|
||||
bundle.js
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
</head>
|
||||
<body>
|
||||
<div></div>
|
||||
<script src="../build/example.js"></script>
|
||||
<script src="./bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -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: {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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,
|
||||
})
|
||||
)
|
||||
})
|
Loading…
Reference in New Issue