From: Evan You Date: Wed, 29 May 2019 02:34:07 +0000 (+0800) Subject: workflow: allow dropping dev only blocks in dev script X-Git-Tag: v3.0.0-alpha.0~985 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6dfec3a4ae0128fc8784453a8f158274a59fbbaf;p=thirdparty%2Fvuejs%2Fcore.git workflow: allow dropping dev only blocks in dev script --- diff --git a/rollup.config.js b/rollup.config.js index 4a24b15d26..5620391737 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 d50168daa0..f266697d68 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 ``` */