Remove all PropTypes in production

This commit is contained in:
Michael Jackson 2019-01-12 19:32:16 -08:00
parent 09914c1db4
commit 59be66f552
2 changed files with 18 additions and 26 deletions

View File

@ -71,19 +71,21 @@ MainTemplate.defaultProps = {
globalScripts: []
};
const htmlType = PropTypes.shape({
__html: PropTypes.string
});
if (process.env.NODE_ENV !== 'production') {
const htmlType = PropTypes.shape({
__html: PropTypes.string
});
MainTemplate.propTypes = {
title: PropTypes.string,
description: PropTypes.string,
favicon: PropTypes.string,
data: PropTypes.any,
content: htmlType,
globalScripts: PropTypes.arrayOf(PropTypes.string),
entryPoints: PropTypes.shape({
module: PropTypes.string,
nomodule: PropTypes.string
}).isRequired
};
MainTemplate.propTypes = {
title: PropTypes.string,
description: PropTypes.string,
favicon: PropTypes.string,
data: PropTypes.any,
content: htmlType,
globalScripts: PropTypes.arrayOf(PropTypes.string),
entryPoints: PropTypes.shape({
module: PropTypes.string,
nomodule: PropTypes.string
}).isRequired
};
}

View File

@ -102,17 +102,7 @@ const functions = [
babel({ exclude: /node_modules/ }),
json(),
resolve(),
commonjs({
// namedExports: {
// 'node_modules/react/index.js': [
// 'createContext',
// 'createElement',
// 'forwardRef',
// 'Component',
// 'Fragment'
// ]
// }
}),
commonjs(),
url({
limit: 5 * 1024,
publicPath: '/_client/',