-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch to web pack dev server for examples
- Loading branch information
1 parent
5497538
commit 31c160d
Showing
6 changed files
with
68 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
node_modules/.bin/webpack-dev-server --inline --content-base examples/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
var fs = require('fs'); | ||
var path = require('path'); | ||
var webpack = require('webpack'); | ||
|
||
var EXAMPLES_DIR = path.resolve(__dirname, 'examples'); | ||
|
||
function isDirectory(dir) { | ||
return fs.lstatSync(dir).isDirectory(); | ||
} | ||
|
||
function buildEntries() { | ||
return fs.readdirSync(EXAMPLES_DIR).reduce(function (entries, dir) { | ||
if (dir === 'build') | ||
return entries; | ||
|
||
var isDraft = dir.charAt(0) === '_'; | ||
|
||
if (!isDraft && isDirectory(path.join(EXAMPLES_DIR, dir))) | ||
entries[dir] = path.join(EXAMPLES_DIR, dir, 'app.js'); | ||
|
||
return entries; | ||
}, {}); | ||
} | ||
|
||
module.exports = { | ||
|
||
entry: buildEntries(), | ||
|
||
output: { | ||
filename: '[name].js', | ||
chunkFilename: '[id].chunk.js', | ||
path: 'examples/__build__', | ||
publicPath: '/__build__/' | ||
}, | ||
|
||
module: { | ||
loaders: [ | ||
{ test: /\.js$/, loader: 'jsx-loader?harmony' } | ||
] | ||
}, | ||
|
||
resolve: { | ||
alias: { | ||
'react-router': '../../modules/index' | ||
} | ||
}, | ||
|
||
plugins: [ | ||
new webpack.optimize.CommonsChunkPlugin('shared.js') | ||
] | ||
|
||
}; |