Improve config, add ExtractTextPlugin and configure launch with 100 size for threadpool

old
Javi Velasco 2015-10-25 20:02:48 +01:00
parent f042376f88
commit b7ba8c1ed0
5 changed files with 12 additions and 7 deletions

View File

@ -2,8 +2,8 @@
import React from 'react';
import ReactDOM from 'react-dom';
import babel from 'babel-core/browser';
import ReactToolbox from 'react-toolbox';
import style from './style';
import Toolbox from 'react-toolbox';
const ERROR_TIMEOUT = 500;
@ -17,7 +17,7 @@ const Preview = React.createClass({
getDefaultProps () {
return {
className: '',
scope: Object.assign({ React }, Toolbox)
scope: Object.assign({ React }, ReactToolbox)
};
},

View File

@ -13,6 +13,7 @@
<meta name="format-detection" content="telephone=no">
<meta name="HandheldFriendly" content="True">
<meta http-equiv="cleartype" content="on">
<link rel="stylesheet" href="/build/docs.css">
</head>
<body>

View File

@ -4,7 +4,7 @@
"description": "Documentation for React Toolbox",
"author": "React Toolbox Team (http://github.com/react-toolbox)",
"scripts": {
"start": "node ./server"
"start": "UV_THREADPOOL_SIZE=100 node ./server"
},
"dependencies": {
"codemirror": "^5.8.0",
@ -18,6 +18,7 @@
"babel-eslint": "^4.1.3",
"babel-loader": "^5.3.2",
"css-loader": "^0.21.0",
"extract-text-webpack-plugin": "^0.8.2",
"node-sass": "^3.3.3",
"postcss-loader": "^0.7.0",
"raw-loader": "^0.5.1",

View File

@ -10,6 +10,7 @@ const devServer = {
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
historyApiFallback: false,
hot: true,
stats: {
colors: true
}

View File

@ -1,6 +1,7 @@
const path = require('path');
const webpack = require('webpack');
const autoprefixer = require('autoprefixer');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const devServer = 'http://0.0.0.0:8080';
module.exports = {
@ -24,8 +25,8 @@ module.exports = {
modulesDirectories: [
'node_modules',
path.resolve(__dirname, './node_modules'),
path.resolve(__dirname, './../components'),
path.resolve(__dirname, './../node_modules')
path.resolve(__dirname, './../node_modules'),
path.resolve(__dirname, './../components')
]
},
module: {
@ -36,16 +37,17 @@ module.exports = {
loader: 'react-hot!babel'
}, {
test: /(\.scss|\.css)$/,
loader: 'style!css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass'
loader: ExtractTextPlugin.extract('style', 'css?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass')
}, {
test: /(\.txt)$/,
loader: 'raw-loader',
loader: 'raw',
include: path.resolve(__dirname, './app/examples')
}
]
},
postcss: [autoprefixer],
plugins: [
new ExtractTextPlugin('docs.css', {allChunks: true}),
new webpack.HotModuleReplacementPlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({