i18n package publish
packing
- 目的是將小塊程式碼編譯成大塊複雜的程式碼
- 精簡打包後的程式碼
rollup
- 打包用的工具
- 簡單輕量,對於簡單的專案剛剛好
- 也可以使用webpack,code splitting與靜態資源導入做得好
- 在開發應用時使用Webpack,開發library時使用Rollup
- 輸出格式
- 對於瀏覽器:iife
- 對於node:cjs
- 對於瀏覽器與node:使用umd
- rollup.config.js (在pi-i18n中使用的設定)
plugins
- rollup-plugin-babel
- 透過babel將js中的es6/7語法轉成瀏覽器支援的語法
- 如果不加可能會在較舊的瀏覽器上出現error
pulish
organizations
package
- version
- name
- main
- npm引入的進入點,會是rollup輸出的檔案位置
- updateDate
- files
- 有哪些檔案要被pulish
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
pulish
- 清空之前build出來的東西
- 用rollup打包新的東西
- 更新package.json的version, updateDate
- (optional) 預覽送出後的文件
- 登入帳號後即可publish
使用
- 把auth token放入設定檔
- 安裝對應版本的pi-i18n
- 在專案中使用