From: Eduardo San Martin Morote Date: Thu, 4 Mar 2021 15:46:25 +0000 (+0100) Subject: build: warnings X-Git-Tag: v2.0.0-alpha.8~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da3cfd689b46a810293f75ff70da26b1c5105de6;p=thirdparty%2Fvuejs%2Fpinia.git build: warnings --- diff --git a/package.json b/package.json index e0cda2a9..c19863a2 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/rollup.config.js b/rollup.config.js index ad9b3af7..8a85437d 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -171,7 +171,10 @@ function createReplacePlugin( replacements[key] = process.env[key] } }) - return replace(replacements) + return replace({ + preventAssignment: true, + values: replacements, + }) } function createProductionConfig(format) { diff --git a/size-checks/rollup.config.js b/size-checks/rollup.config.js index 5b868ef2..b8ff9e67 100644 --- a/size-checks/rollup.config.js +++ b/size-checks/rollup.config.js @@ -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,