cpsat-js 0.1.0-beta.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +15 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,9 +5,23 @@ WebAssembly port of Google OR-Tools' CP-SAT constraint programming solver. Runs
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npm install cpsat-js@beta
8
+ npm install cpsat-js
9
9
  ```
10
10
 
11
+ ## Using with Vite
12
+
13
+ Add `cpsat-js` to `optimizeDeps.exclude` in your `vite.config.ts`:
14
+
15
+ ```ts
16
+ export default defineConfig({
17
+ optimizeDeps: {
18
+ exclude: ['cpsat-js'],
19
+ },
20
+ });
21
+ ```
22
+
23
+ Without this, Vite's dep pre-bundler (esbuild) copies the package into `node_modules/.vite/deps/` and breaks the relative `new URL('../../build/cpsat.wasm', import.meta.url)` lookup — the dev server then returns the SPA HTML fallback for the WASM request, and Emscripten fails with `CompileError: expected magic word 00 61 73 6d, found 3c 21 64 6f` (`<!do`... from the HTML). Excluding the package routes it through Vite's main asset pipeline, which rewrites the URL correctly. Production builds (`vite build`) don't use the pre-bundler and work without this flag, but it's harmless to set in both.
24
+
11
25
  ## Quick Start
12
26
 
13
27
  ```typescript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cpsat-js",
3
- "version": "0.1.0-beta.2",
3
+ "version": "1.0.0",
4
4
  "description": "WebAssembly port of Google OR-Tools CP-SAT constraint programming solver",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",