Introduce feature flag component

Co-authored-by: Andrew Watkins <andrew.watkinz@gmail.com>
Co-authored-by: Brandon Farmer <bthesorceror@gmail.com>
pull/10616/head
Andrew Watkins 2018-03-27 16:54:17 -07:00
parent 6995bdfbca
commit bfbfcc04bd
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,15 @@
import {SFC} from 'react'
interface Props {
children?: any
}
const FeatureFlag: SFC<Props> = props => {
if (process.env.NODE_ENV === 'development') {
return props.children
}
return null
}
export default FeatureFlag

View File

@ -145,6 +145,9 @@ module.exports = {
],
},
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
new webpack.DllReferencePlugin({
context: process.cwd(),
manifest: require('../build/vendor.dll.json'),