]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
build: warnings
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 4 Mar 2021 15:46:25 +0000 (16:46 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 4 Mar 2021 15:46:25 +0000 (16:46 +0100)
package.json
rollup.config.js
size-checks/rollup.config.js

index e0cda2a95b7e0d7dbda968a383e8cff14e7ceb9d..c19863a2c0a4a206503afac08a0ef589470822db 100644 (file)
@@ -13,7 +13,7 @@
     "email": "posva13@gmail.com"
   },
   "scripts": {
-    "build": "rollup -c rollup.config.js",
+    "build": "rimraf dist && rollup -c rollup.config.js",
     "build:dts": "api-extractor run --local --verbose",
     "size": "rollup -c size-checks/rollup.config.js && node scripts/check-size.js",
     "release": "bash scripts/release.sh",
index ad9b3af7bc955881e728c943b14fcf8ab81ed023..8a85437d7627369d1be05f3865303d5d5cd9cdcf 100644 (file)
@@ -171,7 +171,10 @@ function createReplacePlugin(
       replacements[key] = process.env[key]
     }
   })
-  return replace(replacements)
+  return replace({
+    preventAssignment: true,
+    values: replacements,
+  })
 }
 
 function createProductionConfig(format) {
index 5b868ef2439230812c2ee035a5d96ffa0db1c99e..b8ff9e67130387a8df31563719baf57957ae27ce 100644 (file)
@@ -15,17 +15,21 @@ const config = {
   input: path.resolve(__dirname, './small.js'),
   plugins: [
     replace({
-      __DEV__: false,
-      // this is only used during tests
-      __TEST__: false,
-      // If the build is expected to run directly in the browser (global / esm builds)
-      __BROWSER__: true,
-      // is targeting bundlers?
-      __BUNDLER__: false,
-      __GLOBAL__: false,
-      // is targeting Node (SSR)?
-      __NODE_JS__: false,
-      __VUE_PROD_DEVTOOLS__: false,
+      preventAssignment: true,
+      values: {
+        __DEV__: 'false',
+        'process.env.NODE_ENV': JSON.stringify('production'),
+        // this is only used during tests
+        __TEST__: 'false',
+        // If the build is expected to run directly in the browser (global / esm builds)
+        __BROWSER__: 'true',
+        // is targeting bundlers?
+        __BUNDLER__: 'false',
+        __GLOBAL__: 'false',
+        // is targeting Node (SSR)?
+        __NODE_JS__: 'false',
+        __VUE_PROD_DEVTOOLS__: 'false',
+      },
     }),
     ts({
       check: false,