[問題] Web開發最佳實踐?

看板Web_Design作者 (狗狗)時間8年前 (2016/10/03 14:13), 8年前編輯推噓3(300)
留言3則, 3人參與, 最新討論串1/1
想問問 Best Practice 的問題 開發的時候,往往會有分 Production 和 Staging/Development 版本 例如: 1. HTML 中,使用的 Library在 Production 可能用 CDN 的 .min.js 但 Development 可能是用 Local 的 source code 2. JS 中可能有些參數是給 Staging/Development 用的,不希望曝光在 Production 中 3. CSS/SASS/LESS 等,依照環境,是否壓縮最佳化 因此想問問看 Web 開發的最佳實踐,是如何切出 Production/Staging/Development 代碼 我的想法是,資料夾如下 (舉個例子) root/ --- src/ --- index.prod.html | |- index.dev.html | |- JS/ --- app.js (import settings.js) | |- settings.prod.js | |- settings.dev.js | |- dist/ --- index.html |- JS/ --- app.js |- settings.js 利用類似 gulp 或其他工具,將 src/ 底下相關的資源,打包到 dist/ 底下 然後如果選擇打包 dev 環境,就會把 *.dev.* 打包為 *.* (去掉 .dev ) 不知道開發時,最佳實踐是什麼呢?有沒有現有的工具做到這件事? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.120.104.45 ※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1475475239.A.D31.html ※ 編輯: leondemon (123.120.104.45), 10/03/2016 14:18:04

10/03 14:22, , 1F
推一下 我也想知道
10/03 14:22, 1F

10/03 14:36, , 2F
你說到gulp就可以了吧
10/03 14:36, 2F

10/03 21:16, , 3F
git branch?
10/03 21:16, 3F
文章代碼(AID): #1NyVSdqn (Web_Design)
文章代碼(AID): #1NyVSdqn (Web_Design)