or-tools-wasm 0.7.0 → 0.7.1
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.
- package/README.md +47 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,19 @@ Used in [PragmaPlanner.com](https://pragmaplanner.com/?utm_source=or-tools-wasm&
|
|
|
10
10
|
[GitHub](https://github.com/Axelwickm/or-tools-wasm)
|
|
11
11
|
[npm](https://www.npmjs.com/package/or-tools-wasm)
|
|
12
12
|
|
|
13
|
+
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
14
|
+
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
15
|
+
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
16
|
+
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
17
|
+
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
18
|
+
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
19
|
+
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
20
|
+
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
21
|
+
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
22
|
+
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
23
|
+
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
24
|
+
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
25
|
+
|
|
13
26
|
## Install
|
|
14
27
|
|
|
15
28
|
```sh
|
|
@@ -20,19 +33,6 @@ npm install or-tools-wasm
|
|
|
20
33
|
import { CpSat } from 'or-tools-wasm';
|
|
21
34
|
```
|
|
22
35
|
|
|
23
|
-
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
24
|
-
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
25
|
-
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
26
|
-
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
27
|
-
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
28
|
-
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
29
|
-
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
30
|
-
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
31
|
-
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
32
|
-
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
33
|
-
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
34
|
-
[](https://github.com/Axelwickm/or-tools-wasm/actions/workflows/package.yml)
|
|
35
|
-
|
|
36
36
|
Currently supported solvers: CP-SAT.
|
|
37
37
|
|
|
38
38
|
Verified with:
|
|
@@ -155,6 +155,40 @@ export default defineConfig({
|
|
|
155
155
|
});
|
|
156
156
|
```
|
|
157
157
|
|
|
158
|
+
### Webpack
|
|
159
|
+
|
|
160
|
+
For Webpack 5, enable async WebAssembly, emit `.wasm` files as resources, and
|
|
161
|
+
use `publicPath: 'auto'` so worker and WebAssembly URLs resolve from the emitted
|
|
162
|
+
bundle location:
|
|
163
|
+
|
|
164
|
+
```js
|
|
165
|
+
// webpack.config.cjs
|
|
166
|
+
const headers = {
|
|
167
|
+
'Cross-Origin-Opener-Policy': 'same-origin',
|
|
168
|
+
'Cross-Origin-Embedder-Policy': 'require-corp',
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
module.exports = {
|
|
172
|
+
output: {
|
|
173
|
+
publicPath: 'auto',
|
|
174
|
+
},
|
|
175
|
+
experiments: {
|
|
176
|
+
asyncWebAssembly: true,
|
|
177
|
+
},
|
|
178
|
+
module: {
|
|
179
|
+
rules: [
|
|
180
|
+
{
|
|
181
|
+
test: /\.wasm$/,
|
|
182
|
+
type: 'asset/resource',
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
},
|
|
186
|
+
devServer: {
|
|
187
|
+
headers,
|
|
188
|
+
},
|
|
189
|
+
};
|
|
190
|
+
```
|
|
191
|
+
|
|
158
192
|
### Rollup
|
|
159
193
|
|
|
160
194
|
Rollup core does not bundle module workers or emit `new URL(...,
|