Skip to content

Commit

Permalink
Merge pull request #3 from freeshineit/develop
Browse files Browse the repository at this point in the history
feat: update deps
  • Loading branch information
freeshineit committed Mar 7, 2024
2 parents 4d4067b + da3313d commit 51e09d8
Show file tree
Hide file tree
Showing 4 changed files with 457 additions and 595 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ yarn install

# development
# 如果运行时 rust没有编译 , 请移除node_modules重新安装
# 支持热更新
yarn run dev

# production
yarn run build

# https://github.com/http-party/http-server
# version >= 14
cd docs && http-server -p 8080 .
# version >= 18
cd dist && http-server -p 8080 .
```

## Start
Expand All @@ -41,15 +42,20 @@ yarn add sass css-loader style-loader sass-loader -D

```

[webpack config](./webpack.config.js)

### wasm-pack

rust 编译成 `webassembly` 需要 [wasm-pack](https://rustwasm.github.io/wasm-pack/)
rust 编译成 `WebAssembly` 需要 [wasm-pack](https://rustwasm.github.io/wasm-pack/)

```bash
# 不建议全局安装
# 如果wasm-pack 有问题, 请删除 `node_modules`重新安装依赖
yarn add wasm-pack -D

# wasm-pack build --target nodejs
# wasm-pack build --target browser

# webpack plugin
yarn add @wasm-tool/wasm-pack-plugin -D

Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webpack5-rust-wasm-template",
"version": "1.1.0",
"version": "1.1.1",
"main": "dist/index.js",
"keywords": [
"wasm",
Expand All @@ -18,29 +18,29 @@
"fmt": "prettier --write \"**/*.{js,cjs,ts,tsx,scss,css}\""
},
"devDependencies": {
"@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.6.2",
"@swc/core": "^1.4.1",
"@commitlint/cli": "^19.0.3",
"@commitlint/config-conventional": "^19.0.3",
"@swc/core": "^1.4.5",
"@swc/helpers": "^0.5.6",
"@types/node": "^20.11.19",
"@types/node": "^20.11.25",
"@wasm-tool/wasm-pack-plugin": "^1.7.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^6.10.0",
"eslint": "^8.56.0",
"eslint-config-xx": "^1.8.0-alpha.1",
"eslint": "^8.57.0",
"eslint-config-xx": "^1.9.0",
"husky": "^9.0.11",
"only-allow": "^1.2.1",
"prettier": "^3.2.5",
"pretty-quick": "^4.0.0",
"rimraf": "^4.4.1",
"sass": "^1.71.0",
"sass-loader": "^14.1.0",
"rimraf": "^5.0.5",
"sass": "^1.71.1",
"sass-loader": "^14.1.1",
"style-loader": "^3.3.4",
"swc-loader": "^0.2.6",
"tslib": "^2.6.2",
"typescript": "^5.3.3",
"wasm-pack": "^0.12.1",
"webpack": "^5.90.2",
"webpack": "^5.90.3",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.2"
},
Expand Down
8 changes: 8 additions & 0 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@

```bash
cargo test

# wasm-pack (https://rustwasm.github.io/wasm-pack/)
# target node
wasm-pack build --target nodejs


# target browser
wasm-pack build --target browser
```
Loading

0 comments on commit 51e09d8

Please sign in to comment.