View gist:6675c6963f3a9c782bfe49fc9f4a63b6
import DebugInspector from 'ringa-fw-react/src/components/debugInspector/DebugInspector'; | |
import Theme from 'ringa-fw-react/src/components/containers/Theme'; | |
... | |
render() { | |
return <Theme> | |
{this.props.children} // The rest of your application... | |
<DebugInspector /> | |
</Theme>; | |
} |
View webpack.config.prod.bad.js
const webpack = require('webpack'); | |
const path = require('path'); | |
const ROOT_PATH = path.resolve(process.env.PWD); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const UGLIFY_WHITELIST = require('./uglifyWhitelist.json'); | |
require('babel-polyfill'); |
View webpack.config.prod.bad.js
const webpack = require('webpack'); | |
const path = require('path'); | |
const ROOT_PATH = path.resolve(process.env.PWD); | |
const ExtractTextPlugin = require('extract-text-webpack-plugin'); | |
const UGLIFY_WHITELIST = require('./uglifyWhitelist.json'); | |
require('babel-polyfill'); |
View webpack.config.prod.analyze.js
let BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | |
const prodBuild = require('./webpack.config.prod.js'); | |
module.exports = new Promise(resolve => { | |
prodBuild.then(build => { | |
build.plugins.push(new BundleAnalyzerPlugin()); | |
resolve(build); | |
}); | |
}); |
View webpack.config.prod.js
... | |
// Build your configuration object, and then return a Promise | |
let finalConfig = { | |
devtool: 'eval', | |
output: { /* your configuration */ }, | |
plugins: [ /* your configuration */ ] | |
}; |