Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update build target to es2018 #2249

Merged
merged 2 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions _internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"exports": "./dist/index.mjs",
"private": true,
"scripts": {
"watch": "bunchee index.ts -w",
"build": "bunchee index.ts",
"watch": "bunchee --target es2018 index.ts -w",
"build": "bunchee --target es2018 index.ts",
"types:check": "tsc --noEmit",
"clean": "rimraf dist"
},
Expand Down
2 changes: 1 addition & 1 deletion _internal/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const isFunction = <
>(
v: unknown
): v is T => typeof v == 'function'
export const mergeObjects = (a: any, b?: any) => OBJECT.assign({}, a, b)
export const mergeObjects = (a: any, b?: any) => ({ ...a, ...b })

const STR_UNDEFINED = 'undefined'

Expand Down
4 changes: 2 additions & 2 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"exports": "./dist/index.mjs",
"private": true,
"scripts": {
"watch": "bunchee index.ts -w",
"build": "bunchee index.ts",
"watch": "bunchee --target es2018 index.ts -w",
"build": "bunchee --target es2018 index.ts",
"types:check": "tsc --noEmit",
"clean": "rimraf dist"
},
Expand Down
12 changes: 5 additions & 7 deletions core/use-swr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,11 @@ export const useSWRHandler = <Data = any, Error = any>(
return snapshot
}

return Object.assign(
{
isValidating: true,
isLoading: true
},
snapshot
)
return {
isValidating: true,
isLoading: true,
...snapshot
}
}

let memorizedSnapshot = getSelectedCache()
Expand Down
4 changes: 2 additions & 2 deletions immutable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"exports": "./dist/index.mjs",
"private": true,
"scripts": {
"watch": "bunchee index.ts -w",
"build": "bunchee index.ts",
"watch": "bunchee --target es2018 index.ts -w",
"build": "bunchee --target es2018 index.ts",
"types:check": "tsc --noEmit",
"clean": "rimraf dist"
},
Expand Down
4 changes: 2 additions & 2 deletions infinite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"exports": "./dist/index.mjs",
"private": true,
"scripts": {
"watch": "bunchee index.ts -w",
"build": "bunchee index.ts",
"watch": "bunchee --target es2018 index.ts -w",
"build": "bunchee --target es2018 index.ts",
"types:check": "tsc --noEmit",
"clean": "rimraf dist"
},
Expand Down
4 changes: 2 additions & 2 deletions mutation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"exports": "./dist/index.mjs",
"private": true,
"scripts": {
"watch": "bunchee index.ts -w",
"build": "bunchee index.ts",
"watch": "bunchee --target es2018 index.ts -w",
"build": "bunchee --target es2018 index.ts",
"types:check": "tsc --noEmit",
"clean": "rimraf dist"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"clean": "pnpm -r run clean",
"watch": "pnpm -r run watch",
"build": "pnpm build-package _internal && pnpm build-package core && pnpm build-package infinite && pnpm build-package immutable && pnpm build-package mutation",
"build-package": "bunchee index.ts --cwd",
"build-package": "bunchee --target es2018 index.ts --cwd",
"types:check": "pnpm -r run types:check",
"prepublishOnly": "pnpm clean && pnpm build",
"publish-beta": "pnpm publish --tag beta",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"outDir": "./dist",
"rootDir": "./",
"strict": true,
"target": "es5",
"target": "ES2018",
"baseUrl": ".",
"noEmitOnError": true,
"paths": {
Expand Down