@taole/smallgames
v0.2.71
Published
点点小游戏
Readme
数字炸弹说明
https://y-test.tuwan.com/smallGameTips_numBomb https://y-test.tuwan.com/smallGameTips_numBomb
弹幕答题说明
https://y.tuwan.com/smallGameTips_question https://y.tuwan.com/smallGameTips_question
项目介绍
小游戏, 同时支持h5 和 web端npm
项目地址
本地开发环境:https://y-dev.tuwan.com/chartRoom/smallgames
测试环境地址:https://y-test.tuwan.com/smallgames
线上环境地址:https://y.tuwan.com/smallgames
技术栈
svelte、webpack
项目启动
- npm i 安装依赖
- npm run dev 本地开发 访问地址: https://y-dev.tuwan.com:8080/
- npm run build 打包构建
- npm run start 运行打包后的项目
跑起不起来用yarn node 版本 16.13.1
其他
- 项目支持ts,
<script type="ts">就可以启用 ts 检测 - 打包的配置就一个webpack.config.ts
- div 添加点击事件 会报错, 必须给 div 添加 role="presentation"; 这是因为 svelte 的特殊性导致的
- 发布npm的时候执行:npm publish --access public
使用
正常npm 安装, 注意样式的引入:
@import "dd-games/public/build/bundle.css"; 发布测试环境
每次发布请更新版本号(package.json#version)
构建web独立版本(移动端App使用)
npm run build产物在dist目录下- 将
dist/assets/*复制到项目Static的smallgames/assets/下, 更新至Static项目的master分支即可(本质是将构建产物放至cdn, 更新之后10s左右即可访问, 路径: https://asset.tuwan.com/smallgames/assets/xxx) - 将
dist/index.html的文件内容 覆盖项目OfficialSite中的smallgames.htm, 注意OfficialSite项目要使用自己的功能 分支。 同时手动更新测试环境服务器192.168.0.35@root:/home/web/website/tuwan_www/templets/static/play/smallgames.htm
发布对应npm包(PC web大厅使用)
npm run build-npm产物在npm目录下npm publish- 发布完成之后,修改项目ChatRoomSvelteNew中package.json中@taole/smallgames的版本为本次更新的最新版本,更新至其分支
master-test-1023然后在流水线触发ChatRoomSvelteNew-Test
发布到线上
基本类似发布到测试环境
TODO
- 脚本发布测试环境: 基本完成, 考虑补充一个自动增加小版本号 npm version path
