]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
workflow: allow dropping dev only blocks in dev script
authorEvan You <yyx990803@gmail.com>
Wed, 29 May 2019 02:34:07 +0000 (10:34 +0800)
committerEvan You <yyx990803@gmail.com>
Wed, 29 May 2019 02:34:07 +0000 (10:34 +0800)
rollup.config.js
scripts/dev.js

index 4a24b15d26c2208298cf5ebda374ec92563ed5c4..562039173755133cf53aba35a7fe9dfb42ba50f7 100644 (file)
@@ -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)
index d50168daa0e87ba8b949f24685bd9e7de49d0799..f266697d68697574d42b9c90413f4d4ab2990064 100644 (file)
@@ -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
 ```
 */