Skip to content

Commit

Permalink
feat: move size-snapshot behind a flag (--size-snapshot) (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandernanberg authored and Kent C. Dodds committed Aug 12, 2018
1 parent e77293d commit 5aac37c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const format = process.env.BUILD_FORMAT
const isPreact = parseEnv('BUILD_PREACT', false)
const isNode = parseEnv('BUILD_NODE', false)
const name = process.env.BUILD_NAME || capitalize(camelcase(pkg.name))
const useSizeSnapshot = parseEnv('BUILD_SIZE_SNAPSHOT', false)

const defaultGlobals = Object.keys(pkg.peerDependencies || {}).reduce(
(deps, dep) => {
Expand Down Expand Up @@ -145,7 +146,7 @@ module.exports = {
babelrc: true,
}),
replace(replacements),
sizeSnapshot(),
useSizeSnapshot ? sizeSnapshot({printInfo: false}) : null,
minify ? terser() : null,
codeSplitting &&
((writes = 0) => ({
Expand Down
2 changes: 2 additions & 0 deletions src/scripts/build/rollup.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const environment = parsedArgs.environment
? `--environment ${parsedArgs.environment}`
: ''
const watch = parsedArgs.watch ? '--watch' : ''
const sizeSnapshot = parsedArgs['size-snapshot']

let formats = ['esm', 'cjs', 'umd', 'umd.min']

Expand Down Expand Up @@ -100,6 +101,7 @@ function getCommands({preact = false} = {}) {
`BUILD_MINIFY=${buildMinify}`,
`NODE_ENV=${nodeEnv}`,
`BUILD_PREACT=${preact}`,
`BUILD_SIZE_SNAPSHOT=${sizeSnapshot}`,
`BUILD_NODE=${process.env.BUILD_NODE || false}`,
`BUILD_REACT_NATIVE=${process.env.BUILD_REACT_NATIVE || false}`,
].join(' '),
Expand Down

0 comments on commit 5aac37c

Please sign in to comment.