8000 fix: remove "browser" field in package.json (#424) · vuejs/composition-api@4ebeda4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4ebeda4

Browse files
authored
fix: remove "browser" field in package.json (#424)
* fix: remove "browser" field in package.json * fix: esm build
1 parent a8686bb commit 4ebeda4

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

package.json

-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
},
1414
"main": "index.js",
1515
"module": "dist/vue-composition-api.esm.js",
16-
"browser": "dist/vue-composition-api.prod.js",
1716
"unpkg": "dist/vue-composition-ap.prod.js",
1817
"jsdelivr": "dist/vue-composition-api.prod.js",
1918
"typings": "dist/index.d.ts",

rollup.config.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ function genConfig({ outFile, format, mode }) {
6969
}),
7070
resolve(),
7171
replace({
72-
'process.env.NODE_ENV': JSON.stringify(
73-
isProd ? 'production' : 'development'
74-
),
72+
'process.env.NODE_ENV':
73+
format === 'es'
74+
? // preserve to be handled by bundlers
75+
'process.env.NODE_ENV'
76+
: // hard coded dev/prod builds
77+
JSON.stringify(isProd ? 'production' : 'development'),
7578
__DEV__:
7679
format === 'es'
7780
? // preserve to be handled by bundlers

src/apis/inject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function inject(
5353
if (val !== NOT_FOUND) {
5454
return val
5555
} else {
56-
if (defaultValue === undefined && process.env.NODE_ENV !== 'production') {
56+
if (defaultValue === undefined && __DEV__) {
5757
warn(`Injection "${String(key)}" not found`, vm)
5858
}
5959
return defaultValue

0 commit comments

Comments
 (0)
0