W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
開發(fā)工程插件有兩種方法,推薦使用第一種:
mor.config.ts
? 配置文件中進行編寫;npm i @morjs/cli -g
mor init
? 請選擇工程類型 ? - Use arrow-keys. Return to submit.
小程序
小程序插件
小程序分包
? MorJS 工程插件
MorJS 運行時插件
MorJS 運行時解決方案
MorJS 多端組件庫
MorJS 自定義腳手架
? 請選擇工程類型 ? MorJS 工程插件
? 請輸入項目名稱 … myplugin
? 請輸入項目描述 … my first plugin
? 用戶名 … yourUserName
? 郵箱 … your@gmail.com
? 請輸入 Git 倉庫地址 … https://github.com/yourUserName/myplugin
? 請選擇 npm 客戶端 ? npm / pnpm / yarn
mor.config.ts
? 配置文件中進行編寫import { defineConfig } from '@morjs/cli'
export default defineConfig([
{
// name: 'ali',
// sourceType: 'alipay' ,
// target: 'alipay',
// compileMode: 'bundle',
plugins: [
{
name: 'MorJSPluginXXX',
apply(runner) {
// modifyUserConfig: 可基于命令行選項修改用戶配置
runner.hooks.modifyUserConfig.tap(
this.name,
(userConfig, command) => {
const { outputPath } = command.options
// 獲取命令行 outputPath 選項,若有則修改 userConfig 的 outputPath 配置為該值
if (outputPath) userConfig.outputPath = outputPath
return userConfig
}
)
}
}
]
}
])
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: