From 6dfec3a4ae0128fc8784453a8f158274a59fbbaf Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 29 May 2019 10:34:07 +0800 Subject: [PATCH] workflow: allow dropping dev only blocks in dev script --- rollup.config.js | 3 ++- scripts/dev.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/rollup.config.js b/rollup.config.js index 4a24b15d..56203917 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -70,7 +70,8 @@ if (process.env.NODE_ENV === 'production') { module.exports = packageConfigs function createConfig(output, plugins = []) { - const isProductionBuild = /\.prod\.js$/.test(output.file) + const isProductionBuild = + process.env.__DEV__ === 'false' || /\.prod\.js$/.test(output.file) const isGlobalBuild = /\.global(\.prod)?\.js$/.test(output.file) const isBunlderESMBuild = /\.esm\.js$/.test(output.file) const isBrowserESMBuild = /esm-browser(\.prod)?\.js$/.test(output.file) diff --git a/scripts/dev.js b/scripts/dev.js index d50168da..f266697d 100644 --- a/scripts/dev.js +++ b/scripts/dev.js @@ -10,6 +10,9 @@ yarn dev dom # specify the format to output yarn dev core --formats cjs + +# Can also drop all __DEV__ blocks with: +__DEV__=false yarn dev ``` */