This commit is contained in:
陆柯 2023-03-08 23:24:33 +08:00
parent 2f3943a5cc
commit 55d98b487a
2 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,7 @@ LABEL org.opencontainers.image.authors="luk"
RUN npm i -g --registry https://registry.npm.taobao.org @vue/cli@4
RUN cd / && echo -e "\n" | vue create --registry https://registry.npm.taobao.org -p dcloudio/uni-preset-vue uniapp-cli
# 上一行自动选择了第一个空模板,因此需要额外按照 sass
RUN cd /uniapp-cli && npm i -D --registry https://registry.npm.taobao.org sass@1.49.8 sass-loader@8.0.2
EXPOSE 8080

View File

@ -32,4 +32,10 @@ fi
## 选择 Hello uni-app 作为模板,则有 sass 库,并且 src 下具有所有扩展UI组件方便作为定制基础。
## 如果 `rm -fr node_modules && npm i`` 重新安装,再运行 `npm run serve`` 会出错 `Error: Cannot find module 'html-webpack-plugin'`。必须从 vue create 开始才可以运行。
## 严重注意src 必须是直属目录,不能是符号链接!否则不论在 windows / nix 里都无法 npm run serve。
## 严重注意src 必须是直属目录,不能是符号链接!不能用 ln -s 来链接外部项目到 src!
## 否则不论在 windows / nix 里都无法 npm run serve因为 vue-cli 不会对链接目录进行 babel 转译,导致 npm run serve 无法识别 ES6 写法,无法编译通过
## 放在宿主机里运行时,页面显示 invalid host header
# - 通用:在 src/manifest.json 里, "h5" 下,添加 `"devServer" : { "disableHostCheck":true }`
# - Vue3: 在 src/vue.config.js 里,添加 `"devServer" : { "disableHostCheck":true }`
# - Vue2: 在 webpack.dev.conf.js 里,添加 `"devServer" : { "disableHostCheck":true }`