添加构建发布命令

更新说明文档
This commit is contained in:
2020-05-24 19:31:01 +08:00
parent 81dea02744
commit 4d62220db9
6 changed files with 20 additions and 9 deletions

1
.gitignore vendored
View File

@@ -1,4 +1,5 @@
dist/ dist/
node_modules/ node_modules/
yarn.lock yarn.lock
package-lock.json
*.xlsl *.xlsl

View File

@@ -24,13 +24,18 @@
* 空(`null`) * 空(`null`)
* 该工具设计原则是简单易用,表格字段可由策划自由调整,不支持数据引用,暂不支持结构体 * 该工具设计原则是简单易用,表格字段可由策划自由调整,不支持数据引用,暂不支持结构体
## Windows 安装 ## 安装
安装 NodeJS, 注意勾选将 Node 添加到环境变量 `PATH` - 安装 NodeJS 和 NPM, 注意将 Node 和 NPM 添加到环境变量 `PATH`
- 执行下面的命令构建项目,将生成的 `dist` 复制到到您的项目中
```
npm run build
```
## 使用 ## 使用
修改配置表 - 按照上面介绍的规则填写 Excel 配置表
修改 excel-exporter.json 修改工具配置 - 修改 `excel-exporter.json` 修改工具配置,配置要读取的 Excel 文件列表,配置你需要的导出器
双击 转表.bat 执行转换工作 - Windows 下双击 `转表.bat` 执行转换工作
- Linux/macOS 下执行 `转表.sh` 执行转换工作
### 配置示例 ### 配置示例

View File

@@ -2,13 +2,15 @@
"name": "tiny-nodejs-starter-kit", "name": "tiny-nodejs-starter-kit",
"version": "1.0.0", "version": "1.0.0",
"main": "index.js", "main": "index.js",
"license": "MIT", "license": "BSD",
"scripts": { "scripts": {
"dev": "node_modules/.bin/webpack --config webpack.config.js --watch", "dev": "node_modules/.bin/webpack --config webpack.config.js --watch",
"compile": "node_modules/.bin/webpack --config webpack.config.js --env.production" "compile": "node_modules/.bin/webpack --config webpack.config.js --env.production",
"build": "node ./tools/build.js"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^14.0.1", "@types/node": "^14.0.1",
"shelljs": "^0.8.4",
"ts-loader": "^7.0.4", "ts-loader": "^7.0.4",
"tsconfig-paths-webpack-plugin": "^3.2.0", "tsconfig-paths-webpack-plugin": "^3.2.0",
"typescript": "^3.9.2", "typescript": "^3.9.2",

3
tools/build.js Normal file
View File

@@ -0,0 +1,3 @@
const shell = require("shelljs");
shell.exec("npm install && npm run compile")
shell.cp(["转表.bat", "转表.sh", "excel-exporter.json"], "dist")

View File

@@ -1,2 +1,2 @@
call node ./dist/binary.js ./excel-exporter.json call node ./binary.js ./excel-exporter.json
pause pause

View File

@@ -1,2 +1,2 @@
#!/bin/bash #!/bin/bash
node ./dist/binary.js ./excel-exporter.json node ./binary.js ./excel-exporter.json