From 3d4b516683143c6c5758971ea39fc097cb6b0571 Mon Sep 17 00:00:00 2001
From: debater-coder <52619668+debater-coder@users.noreply.github.com>
Date: Sun, 10 Jul 2022 18:19:28 +1000
Subject: [PATCH 1/5] Specify that `es2020` is required
---
README.md | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/README.md b/README.md
index ff14a5da0..48b8847a3 100644
--- a/README.md
+++ b/README.md
@@ -38,6 +38,18 @@ Then you can use modules like this:
import { Alg } from "cubing/alg";
import { TwistyPlayer } from "cubing/twisty";
```
+Note that `cubing.js` requires `es2020` or higher. If you are using vite, then you will have to put this in your `vite.config.ts`:
+```ts
+import {UserConfig} from "vite";
+
+const config: UserConfig = {
+ build: {
+ target: "es2020"
+ }
+}
+
+export default config
+```
## Contributing
From 0c0dcab92e54249e52f0ec1175d8dd41f56337a9 Mon Sep 17 00:00:00 2001
From: debater-coder <52619668+debater-coder@users.noreply.github.com>
Date: Mon, 11 Jul 2022 19:52:28 +1000
Subject: [PATCH 2/5] Update README.md
---
README.md | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index 48b8847a3..0072465f9 100644
--- a/README.md
+++ b/README.md
@@ -38,17 +38,17 @@ Then you can use modules like this:
import { Alg } from "cubing/alg";
import { TwistyPlayer } from "cubing/twisty";
```
-Note that `cubing.js` requires `es2020` or higher. If you are using vite, then you will have to put this in your `vite.config.ts`:
-```ts
-import {UserConfig} from "vite";
-const config: UserConfig = {
+## Using with bundlers
+
+Note that `cubing.js` requires `es2020` or higher. If you are using a bundler that transpiles your code for compatibility, you must specify a build target of at least `es2020` or higher. For example, if you are using `vite`, put this in your `vite.config.js`:
+```js
+
+export default {
build: {
target: "es2020"
}
}
-
-export default config
```
## Contributing
From b6e59c165f0cf18b9cdd81f9fd785003977ad68f Mon Sep 17 00:00:00 2001
From: debater-coder <52619668+debater-coder@users.noreply.github.com>
Date: Mon, 11 Jul 2022 19:52:58 +1000
Subject: [PATCH 3/5] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 0072465f9..4b9022e45 100644
--- a/README.md
+++ b/README.md
@@ -45,7 +45,9 @@ Note that `cubing.js` requires `es2020` or higher. If you are using a bundler th
```js
export default {
+ // ...
build: {
+ // ...
target: "es2020"
}
}
From ab143309585f3751fe8136094deb8cb1544967b6 Mon Sep 17 00:00:00 2001
From: Hamzah Ahmed
The npm
packagenpm
package should work with any modern bundlers and tools. If you are having trouble, make sure your tool is compatible with ES2020 syntax. We recommend using esbuild
or tools based on esbuild
, and you may find this project template a helpful start.
+ By default, Vite, an esbuild
-based bundler, transpiles code to ES2019. To use the npm
package with Vite, add this to your vite.config.js
:
+
+ export default {build: {target: "es2020"}}
+
+