Update server config for documentation
parent
8e00f773b1
commit
9fc08b6106
|
@ -2,10 +2,11 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import Button from 'react-toolbox/button';
|
||||
import style from 'react-toolbox/commons';
|
||||
|
||||
const App = () => {
|
||||
return (
|
||||
<app>
|
||||
<app >
|
||||
<Button label='Testing Toolbox' />
|
||||
</app>
|
||||
);
|
||||
|
|
|
@ -13,13 +13,10 @@
|
|||
<meta name="format-detection" content="telephone=no">
|
||||
<meta name="HandheldFriendly" content="True">
|
||||
<meta http-equiv="cleartype" content="on">
|
||||
<link rel="stylesheet" href="./build/react-toolbox-docs.commons.css">
|
||||
<link rel="stylesheet" href="./build/react-toolbox-docs.test.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Testing boilerplate</h1>
|
||||
<div id="app"></div>
|
||||
<script src="./build/react-toolbox-docs.test.js"></script>
|
||||
<script src="/build/docs.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -4,27 +4,24 @@
|
|||
"description": "Documentation for React Toolbox",
|
||||
"author": "React Toolbox Team (http://github.com/react-toolbox)",
|
||||
"scripts": {
|
||||
"start": "npm run build & webpack-dev-server --hot",
|
||||
"build": "webpack"
|
||||
"start": "node ./server"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^0.14.0",
|
||||
"react-dom": "^0.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"autoprefixer-core": "^5.1.11",
|
||||
"autoprefixer": "^6.0.3",
|
||||
"babel": "^5.8.23",
|
||||
"babel-core": "^5.8.23",
|
||||
"babel-eslint": "^4.1.3",
|
||||
"babel-loader": "^5.3.2",
|
||||
"babel-runtime": "^5.8.20",
|
||||
"css-loader": "^0.16.0",
|
||||
"extract-text-webpack-plugin": "^0.8.1",
|
||||
"css-loader": "^0.21.0",
|
||||
"node-sass": "^3.3.3",
|
||||
"normalize.css": "^3.0.3",
|
||||
"postcss-loader": "^0.4.3",
|
||||
"react": "^0.14.0",
|
||||
"postcss-loader": "^0.7.0",
|
||||
"react-hot-loader": "^1.3.0",
|
||||
"sass-loader": "^2.0.1",
|
||||
"style-loader": "^0.12.3",
|
||||
"sass-loader": "^3.0.0",
|
||||
"style-loader": "^0.13.0",
|
||||
"webpack": "^1.12.0",
|
||||
"webpack-dev-server": "^1.12.1"
|
||||
},
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
const webpack = require('webpack');
|
||||
const WebpackDevServer = require('webpack-dev-server');
|
||||
const config = require('./webpack.config');
|
||||
const devServer = {
|
||||
host: '0.0.0.0',
|
||||
port: 3000,
|
||||
inline: true
|
||||
};
|
||||
|
||||
new WebpackDevServer(webpack(config), {
|
||||
publicPath: config.output.publicPath,
|
||||
historyApiFallback: false,
|
||||
stats: {
|
||||
colors: true
|
||||
}
|
||||
}).listen(devServer.port, devServer.host, (err) => {
|
||||
if (err) console.error(err);
|
||||
console.log(`Listening at ${devServer.host}:${devServer.port}`);
|
||||
console.log(`open http://${devServer.host}:${devServer.port}/spec/`);
|
||||
});
|
|
@ -1,13 +1,23 @@
|
|||
var pkg = require('./package.json');
|
||||
var path = require('path');
|
||||
var node_modules = __dirname + '/node_modules';
|
||||
var ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||
var environment = process.env.NODE_ENV;
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const autoprefixer = require('autoprefixer');
|
||||
const devServer = 'http://0.0.0.0:3000';
|
||||
|
||||
module.exports = {
|
||||
cache: true,
|
||||
context: __dirname,
|
||||
devtool: '#eval-source-map',
|
||||
entry: [
|
||||
'webpack-dev-server/client?' + devServer,
|
||||
'webpack/hot/only-dev-server',
|
||||
'./app/index.jsx'
|
||||
],
|
||||
output: {
|
||||
path: path.join(__dirname, 'build'),
|
||||
filename: 'docs.js',
|
||||
publicPath: '/build/'
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['', '.jsx', '.scss', '.css', '.js', '.json'],
|
||||
extensions: ['', '.jsx', '.scss', '.js', '.json'],
|
||||
alias: {
|
||||
'react-toolbox': path.resolve(__dirname + './../components')
|
||||
},
|
||||
|
@ -18,27 +28,24 @@ module.exports = {
|
|||
path.resolve(__dirname, './../node_modules')
|
||||
]
|
||||
},
|
||||
context: __dirname,
|
||||
entry: {
|
||||
commons: [path.resolve(__dirname, './../components/commons')],
|
||||
test: ['webpack/hot/dev-server', './app/index.jsx']
|
||||
},
|
||||
output: {
|
||||
path: environment === 'production' ? './dist' : './build',
|
||||
filename: pkg.name + '.[name].js',
|
||||
publicPath: '/build/'
|
||||
},
|
||||
devServer: {
|
||||
host: '0.0.0.0',
|
||||
port: 3000,
|
||||
inline: true
|
||||
},
|
||||
module: {
|
||||
loaders: [
|
||||
{ test: /(\.js|\.jsx)$/, exclude: [node_modules], loaders: ['babel'] },
|
||||
{ test: /(\.scss|\.css)$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader!sass') }
|
||||
{
|
||||
test: /(\.js|\.jsx)$/,
|
||||
exclude: /(node_modules)/,
|
||||
loader: 'react-hot!babel'
|
||||
}, {
|
||||
test: /(\.scss|\.css)$/,
|
||||
loader: 'style!css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass'
|
||||
}
|
||||
]
|
||||
},
|
||||
postcss: [require('autoprefixer-core')],
|
||||
plugins: [new ExtractTextPlugin(pkg.name + '.[name].css', {allChunks: true})]
|
||||
postcss: [autoprefixer],
|
||||
plugins: [
|
||||
new webpack.HotModuleReplacementPlugin(),
|
||||
new webpack.optimize.OccurenceOrderPlugin(),
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': JSON.stringify('development')
|
||||
})
|
||||
]
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue