Skip to content

Commit

Permalink
[docs] Update Vite sample code.
Browse files Browse the repository at this point in the history
Even Vite 3 still seems to have issues: vitejs/vite#9062 (comment)
  • Loading branch information
lgarron committed Jul 18, 2022
1 parent ae6b384 commit b9a5626
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/cubing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ <h2>Compatibility</h2>
The <code>npm</code> package should work with any modern bundlers and tools. If you are having trouble, <b>make sure your tool is compatible with ES2020 syntax</b>. We recommend using <a href="https://esbuild.github.io/"><code>esbuild</code></a> or tools based on <code>esbuild</code>, and you may find <a href="https://github.com/cubing/cubing-app-template">this project template</a> a helpful start.
</p>
<h3>Known Issues</h3>
<p><a href="https://vitejs.dev/">Vite</a> 3 does not support full ES2020 by default. Use the following config:</p>
<p><a href="https://vitejs.dev/">Vite</a> does not support full ES2020 by default. Use the following config:</p>
<code class="sample">
// vite.config.js<br>
export default {build: {target: "es2020"}};
export default { optimizeDeps: { esbuildOptions: { target: "es2020" } } };
</code>
</section>

Expand Down
2 changes: 1 addition & 1 deletion src/cubing/alg/Alg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class Alg extends AlgCommon<Alg> {

for (const unit of this.#units) {
if (!experimentalIsUnit(unit)) {
throw new Error("An alg can only contain units.");
throw new Error("An alg can only contain alg nodes.");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cubing/alg/test/alg.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe("Alg", () => {

it("throws an error for a nested Alg", () => {
expect(() => new Alg([new Alg([new Move("R", 1)])])).toThrowError(
/An alg can only contain units./,
/An alg can only contain alg nodes./,
);
});
});
Expand Down

0 comments on commit b9a5626

Please sign in to comment.