Introduce feature flag component
Co-authored-by: Andrew Watkins <andrew.watkinz@gmail.com> Co-authored-by: Brandon Farmer <bthesorceror@gmail.com>pull/3074/head
parent
d2dec6026f
commit
85ee653b77
|
@ -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
|
|
@ -145,6 +145,9 @@ module.exports = {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
new webpack.DefinePlugin({
|
||||||
|
'process.env.NODE_ENV': JSON.stringify('development'),
|
||||||
|
}),
|
||||||
new webpack.DllReferencePlugin({
|
new webpack.DllReferencePlugin({
|
||||||
context: process.cwd(),
|
context: process.cwd(),
|
||||||
manifest: require('../build/vendor.dll.json'),
|
manifest: require('../build/vendor.dll.json'),
|
||||||
|
|
Loading…
Reference in New Issue