銆孯eact/Vue銆?/strong>搴旂敤鑷姩鍖栨瀯寤鸿剼鎵嬫灦锛屽叾闆堕厤缃紑绠卞嵆鐢ㄧ殑浼樼偣闈炲父閫傚悎鍏ラ棬绾с€佸垵涓骇銆佸揩閫熷紑鍙戦」鐩殑鍓嶇鍚屽浣跨敤锛岃繕鍙€氳繃鍒涘缓brucerc.js鏂囦欢瑕嗙洊鍏堕粯璁ら厤缃紝鍙渶"/>

鎺ㄨ崘涓€涓浂閰嶇疆寮€绠卞嵆鐢ㄧ殑React/Vue搴旂敤鑷姩鍖栨瀯寤鸿剼鎵嬫灦锛屼笉寮哄ぇ浣犳潵鎵炬垜

Posted 鍓嶇澶у叏

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了鎺ㄨ崘涓€涓浂閰嶇疆寮€绠卞嵆鐢ㄧ殑React/Vue搴旂敤鑷姩鍖栨瀯寤鸿剼鎵嬫灦锛屼笉寮哄ぇ浣犳潵鎵炬垜相关的知识,希望对你有一定的参考价值。

锛堢粰鍓嶇澶у叏鍔犳槦鏍囷紝鎻愬崌鍓嶇鎶€鑳?/span>锛?/span>

bruce-cli鏄竴涓?span class="mq-9">銆孯eact/Vue銆?/strong>搴旂敤鑷姩鍖栨瀯寤鸿剼鎵嬫灦锛屽叾闆堕厤缃紑绠卞嵆鐢ㄧ殑浼樼偣闈炲父閫傚悎鍏ラ棬绾с€佸垵涓骇銆佸揩閫熷紑鍙戦」鐩殑鍓嶇鍚屽浣跨敤锛岃繕鍙€氳繃鍒涘缓brucerc.js鏂囦欢瑕嗙洊鍏堕粯璁ら厤缃紝鍙渶涓撴敞涓氬姟浠g爜鐨勭紪鍐欐棤闇€鍏虫敞鏋勫缓浠g爜鐨勭紪鍐欙紝璁╅」鐩粨鏋勬洿绠€娲併€傝鎯呰鎴宠繖閲岋紝浣跨敤鏃惰寰楁煡鐪嬫枃妗e摕锛屽枩娆㈢殑璇濈粰涓猄tar

bruce-cli

馃帴鑳屾櫙

鍦ㄥ墠绔妧鏈殑鏃ョ泭澹ぇ涓嬶紝浠庝互鍓嶇畝鍗曠殑鍑犱釜鏂囦欢鍒扮幇鍦ㄥ鏉傜殑涓€鍫嗘枃浠讹紝鍚勭鎵╁睍鍜屽伐鍏锋鍏ュ埌椤圭洰閲岋紝浣垮緱椤圭洰瓒婃潵瓒婂簽澶ц秺鏉ヨ秺闅剧鐞嗭紝鍓嶇椤圭洰涔熷洜姝よ秼浜?code class="mq-17">宸ョ▼鍖?/code>鍜?code class="mq-18">涓€浣撳寲銆傛棩鏂版湀寮傜殑鍓嶇鎶€鏈凡璁╁墠绔唬鐮佺殑涓氬姟閫昏緫鍜屼氦浜掓晥鏋滆秺鏉ヨ秺澶嶆潅锛岄」鐩細涓€鐩寸淮鎶ゅ拰杩唬锛屼护寮€鍙戣€呮洿鍔犱笉鏄撲簬绠$悊銆傛ā鍧楀寲寮€鍙戝拰鍚勭妗嗘灦鎶婇」鐩垎鎴愯嫢骞蹭釜灏忔ā鍧楋紝澧炲姞浜嗘渶鍚庡彂甯冪殑鍥伴毦锛屾棤涓€涓粺涓€鐨勬爣鍑嗭紝璁╁墠绔」鐩粨鏋勫崈濂囩櫨鎬€傞€氬父鐨勯」鐩兘鏄洟闃熷紑鍙戯紝姣忎釜浜虹殑浠g爜缂栧啓涔犳儻鍜岄€昏緫缂栧啓椋庢牸涔熷緢闅句竴鑷淬€傚伐浣滃洿缁曠潃銆屽紑鍙戞晥鐜囥€?/strong>鍜?span class="mq-20">銆岃繍琛屾€ц兘銆?/strong>鐨勫伐绋嬪寲闂鏄垜浠綔涓哄墠绔紑鍙戣€呭繀椤诲緱澶勭悊鐨勯棶棰樸€傚洜姝ゅ墠绔」鐩嚜鍔ㄥ寲鏋勫缓鍦ㄦ暣涓」鐩紑鍙戜腑瓒婃潵瓒婇噸瑕併€?/p>

馃敆渚濊禆

鏈」鐩槸涓€涓熀浜?code class="mq-25">Webpack4.x.x寮€鍙戠殑鏋侀€熼浂閰嶇疆寮€绠卞嵆鐢ㄧ殑Web搴旂敤鏋勫缓宸ュ叿(銆屾瘡娆℃洿鏂伴兘浼氫繚鎸佹渶鏂颁緷璧栥€?/strong>)锛岄泦鎴愬悇绉嶅父鐢ㄥ伐鍏?Handlebars銆丳ostcss銆?code class="mq-28">Polyfill銆?code class="mq-29">Sass銆?code class="mq-30">Less銆?code class="mq-31">Babel銆?code class="mq-32">TypeScript銆?code class="mq-33">Stylelint銆?code class="mq-34">Eslint銆?code class="mq-35">Cssnano銆?code class="mq-36">Uglifyjs銆?code class="mq-37">Terser鍜?code class="mq-38">Tinyimg绛?鎵╁睍鏋勫缓鍔熻兘锛岀敤浜庢瀯寤哄拰绠$悊銆孯eact/Vue銆?/strong>鎶€鏈爤鐨勯」鐩簲鐢?/p>

馃摝瀹夎

npm i -g bruce-cli

瀹夎澶辫触

  • 鍒囨崲 銆孨PM闀滃儚銆?/strong>涓烘窐瀹濋暅鍍忥細 npm config set registry https://registry.npm.taobao.org/
  • 鍒囨崲 銆孨ode闀滃儚銆?/strong>涓烘窐瀹濋暅鍍忥細 npm config set disturl https://npm.taobao.org/mirrors/node/
  • 閲嶆柊鎵ц瀹夎鍛戒护锛? npm i -g bruce-cli

馃捇浣跨敤

~ 鍛戒护 缂╁啓
鏋勫缓椤圭洰 銆宐ruce build銆?/strong> bruce b
鍒濆椤圭洰 銆宐ruce init銆?/strong> bruce i
鍒囨崲璇█ 銆宐ruce locale銆?/strong> bruce l
鍒涘缓缁勪欢 銆宐ruce new銆?/strong> bruce n
鍒犻櫎渚濊禆 銆宐ruce remove銆?/strong> bruce r

鈽庯笍璇█

  • 銆寊h-chs銆?/strong>锛氱畝浣撲腑鏂?nbsp; 銆?span class="mq-104">榛樿銆?/strong>
  • 銆寊h-cht銆?/strong>锛氱箒楂斾腑鏂?
  • 銆宔n銆?/strong>锛欵nglish

馃挕鍔熻兘

鍛戒护鍔熻兘

  • 銆屾瀯寤洪」鐩€?/strong>锛氭牴鎹粓绔氦浜掑紡闂瓟閫夋嫨鎵€闇€閰嶇疆鏋勫缓椤圭洰锛屽彲閫夊紑鍙戠幆澧冦€佹祴璇曠幆澧冨拰鐢熶骇鐜
  • 銆屽垵濮嬮」鐩€?/strong>锛氭牴鎹粓绔氦浜掑紡闂瓟閫夋嫨鎵€闇€閰嶇疆鐢熸垚椤圭洰鐨勯鏋舵枃浠跺拰鍏ュ彛鏂囦欢
  • 銆屽垏鎹㈣瑷€銆?/strong>锛氭牴鎹粓绔氦浜掑紡闂瓟閫夋嫨鎵€闇€閰嶇疆鍒囨崲缁堢鏂囨湰璇█锛屽彲閫夌畝浣撲腑鏂囥€佺箒浣撲腑鏂囧拰鑻辨枃
  • 銆屽垱寤虹粍浠躲€?/strong>锛氭牴鎹粓绔氦浜掑紡闂瓟杈撳叆鎵€闇€閰嶇疆鍦ㄩ」鐩牴鐩綍瀵瑰簲鐨勮矾寰勪笅鍒涘缓妯℃澘鏂囦欢
  • 銆屽垹闄や緷璧栥€?/strong>锛氬揩閫熷垹闄ら」鐩緷璧栨枃浠跺拰渚濊禆閿佸畾鏂囦欢

鍐呯疆鍔熻兘

  • 銆岄€夋嫨妯″紡銆?/strong>锛氭彁渚? 寮€鍙戠幆澧?/code>銆? 娴嬭瘯鐜鍜? 鐢熶骇鐜涓夌妯″紡锛屾瘡绉嶆ā寮忓搴斾笉鍚岀殑鏋勫缓閰嶇疆鍜屼紭鍖栨柟妗?
  • 銆岀洃鍚鍙c€?/strong>锛氫娇鐢ㄥ紑鍙戞ā寮忔椂锛屽惎鍔ㄦ湰鍦版湇鍔″櫒骞剁洃鍚寚瀹氱鍙o紝鍙嚜鍔ㄦ墦寮€娴忚鍣ㄨ闂〉闈?
  • 銆屽眬閮ㄥ埛鏂般€?/strong>锛氬惎鐢╓ebpack鍐呯疆 Hot Module Replacement锛岄厤鍚? react-hot-loader鎴? vue-loader澧為噺鏇存柊 css鏂囦欢鍜? js鏂囦欢锛屼慨鍝洿鍝紝鏃犻渶鍒锋柊椤甸潰鍗冲彲瀹炴椂棰勮淇敼缁撴灉锛屽苟淇濆瓨褰撳墠鏁版嵁鐘舵€?
  • 銆屽垽鏂叆鍙c€?/strong>锛氬揩閫熸壂鎻忛」鐩寚瀹氱殑鍏ュ彛鏂囦欢璺緞锛屽垽鏂叾鏄惁瀛樺湪鍜屽悎娉曪紝椤圭洰鏋勫缓鏃朵互鍏ュ彛鏂囦欢浣滀负鏍硅妭鐐癸紝蹇呴』寰椾繚璇佸叾瀛樺湪鍜屽悎娉?
  • 銆屾彃鍏ュ灚鐗囥€?/strong>锛氭牴鎹」鐩祻瑙堝櫒鍏煎鎬ц嚜鍔ㄦ彃鍏ュ灚鐗囷紝鍏煎浣庣増鏈祻瑙堝櫒
    • 鎻掑叆鍔ㄦ€? polyfill锛屾牴鎹祻瑙堝櫒璇锋眰鏃剁殑 UserAgent杩斿洖鍨墖鏂囦欢锛? babel缂栬瘧JS浠g爜鏃跺氨鏃犻渶甯︿笂鍨墖缂栬瘧锛岃捣鍒? 鍑忓寘浣滅敤
    • 鎻掑叆闈欐€? polyfill锛屾牴鎹? browserslist鍜岀紪鍐欎唬鐮佷腑鐨凟S6璇硶鑷姩鎻掑叆鎵€闇€鍨墖
  • 銆屽姩鎬佸鍏ャ€?/strong>锛氬彲浣跨敤鍔ㄦ€佸鍏ヨ娉? import().then())锛屽鐞嗕唬鐮佹椂浼氬崟鐙垎绂昏妯″潡锛屾墽琛岄〉闈㈠搴旀搷浣滄椂鎵嶅姞杞借妯″潡锛屼娇鐢ㄦ墠鍔犺浇涓嶄娇鐢ㄥ垯涓嶅姞杞? 浠g爜鎳掑姞杞?/code>)锛屽噺灏戦灞忓姞杞戒唬鐮佸ぇ灏忓拰娓叉煋鏃堕棿
  • 銆岀紪璇戜唬鐮併€?/strong>锛氬唴缃瓹SS缂栬瘧鍣? postcss/sass/less)鍜孞S缂栬瘧鍣? babel/typescript)缂栬瘧鏍峰紡鍜岃剼鏈紝寮€鍙戞椂鍙娇鐢ㄦ渶鏂扮壒鎬ф垨鑽夋瑙勮寖鐨勮娉曪紝浣垮緱浠g爜鏇寸畝娲侊紝鎻愰珮浠g爜鐨勫彲璇绘€?
    • 鍐呯疆 raw-loader锛岀敤浜庡鐞? txt鏂囦欢锛屾妸鏂囦欢鍐呭浠ュ瓧绗︿覆鐨勫舰寮忓鍏?
    • 鍐呯疆 handlebars-loader锛岀敤浜庡鐞? 鍐呰仈html鍜? hbs鏂囦欢锛屾妸HTML鍏冪礌浠ュ唴鑱旂殑褰㈠紡鎻掑叆鍒伴〉闈腑
    • 鍐呯疆 style-loader鍜? css-loader锛岀敤浜庡鐞? css鏂囦欢(鍖呭惈 sass/scss/less杞崲鍚庣殑 css鏂囦欢)锛屾妸CSS浠嶫S涓崟鐙娊绂诲嚭鏉?
    • 鍐呯疆 postcss-loader锛岀敤浜庡鐞咰SS鏈€鏂扮壒鎬у拰鑽夋瑙勮寖锛屾牴鎹? browserslist澧炲姞CSS灞炴€у墠缂€
    • 鍐呯疆 sass-loader锛岀敤浜庡鐞? sass鏂囦欢鍜? scss鏂囦欢锛岄€氳繃 dart-sass灏? sass/scss缂栬瘧鎴? css
    • 鍐呯疆 less-loader锛岀敤浜庡鐞? less鏂囦欢锛岄€氳繃 less灏? sass/less缂栬瘧鎴? css
    • 鍐呯疆 babel-loader锛屾牴鎹璁剧幆澧冨拰 browserslist骞剁粨鍚? polyfill澶勭悊缂栧啓鐨? ES6浠g爜鍜? TS浠g爜锛屽苟鐢熸垚澶т紬娴忚鍣ㄥ彲璇嗗埆鐨? ES5浠g爜
  • 銆屾牎楠屼唬鐮併€?/strong>锛氱‘淇濈紪鍐欑殑璇硶鏃犻敊璇紝缁熶竴瑙勮寖鍥㈤槦鍗忎綔涓瘡浣嶅悓浜嬬殑浠g爜缂栧啓椋庢牸锛屽噺灏戜唬鐮佸啑浣欙紝鍦ㄤ繚璇佷唬鐮佽娉曟纭殑鍓嶆彁涓嬫彁楂樹唬鐮佺殑鍙鎬?
    • CSS鏍¢獙锛氬唴缃? stylelint锛岄厤缃爣鍑嗙殑CSS璇硶瑙勫垯锛屾鏌ュ拰绾犳鍑虹幇鐨勮娉曢敊璇?
    • JS鏍¢獙锛氬唴缃? eslint锛岄厤缃爣鍑嗙殑JS鍜孴S璇硶瑙勫垯锛屾鏌ュ拰绾犳鍑虹幇鐨勮娉曢敊璇?
  • 銆屽垎鍓蹭唬鐮併€?/strong>锛氭瀯寤轰笟鍔′唬鐮侊紝灏嗗叾鍒嗗壊鎴? WebpackRuntime浠g爜鍧?/code>銆? 绗笁鏂逛緷璧栦唬鐮佸潡銆? 鍏叡涓氬姟浠g爜鍧?/code>鍜? 鍗曚釜涓氬姟浠g爜鍧?/code>鍥涘ぇ閮ㄥ垎
  • 銆屽悎骞朵唬鐮併€?/strong>锛氶€氳繃瀵圭浉鍚屾ā鍧椼€佺浉鍚屽姛鑳藉拰澶嶇敤澶氭鐨勪唬鐮佹暣浣撳悎骞讹紝璧峰埌 鍑忓寘浣滅敤
  • 銆屽弸濂芥彁绀恒€?/strong>锛氬綋閬囧埌璀﹀憡鍜岄敊璇椂杈撳嚭璇硶楂樹寒鐨勪唬鐮佺墖娈靛拰瑙e喅鏂瑰紡锛屽府鍔╁紑鍙戣€呭畾浣嶉棶棰?
  • 銆屽帇缂╁悎骞躲€?/strong>锛?
    • CSS鍘嬬缉锛氬唴缃? cssnano锛屽帇缂╁幓閲嶆娊绂诲嚭鏉ョ殑CSS
    • JS鍘嬬缉锛氬唴缃? uglifyjs鍜? terser锛屽帇缂╁幓閲嶆娊绂诲嚭鏉ョ殑JS锛? uglifyjs鐢ㄤ簬鍘嬬缉 ES5锛? terser鐢ㄤ簬鍘嬬缉 ES6
    • 鍥惧儚鍘嬬缉锛氬唴缃? tinyimg锛屾棤鎹熷帇缂? jpg鍜? png鍥惧儚
  • 銆屼唬鐞嗘帴鍙c€?/strong>锛氫娇鐢? proxy鍙嶅悜浠g悊鏈嶅姟绔帴鍙o紝瑙e喅鎺ュ彛璺ㄥ煙闂
  • 銆屽鐞嗚祫婧愩€?/strong>锛氬唴缃? file-loader鍜? url-loader锛岀敤浜庡鐞嗗瓧浣撱€佸浘鍍忋€侀煶棰戝拰瑙嗛绛夊獟浣撹祫婧愶紝鍥惧儚灏忎簬10k鏃惰浆鎹负 Base-64 URL
  • 銆屾彁鍗囦綔鐢ㄣ€?/strong>锛氬惎鐢╓ebpack鍐呯疆 Scope Hoisting锛屽垎鏋愬嚭妯″潡闂寸殑渚濊禆鍏崇郴锛屾妸鏋勫缓濂界殑妯″潡鍚堝苟鍒颁竴涓嚱鏁颁腑锛岃捣鍒? 鍑忓寘浣滅敤
  • 銆屾憞鏍戜紭鍖栥€?/strong>锛氬惎鐢╓ebpack鍐呯疆 Tree Shaking锛岀姝? babel鎶婁唬鐮佽浆鎹㈡垚 CommonJS瑙勮寖锛屼娇鐢? ESM瑙勮寖鐨勯潤鎬佸0鏄庣壒鐐瑰幓闄や笉琚紩鐢ㄦ垨涓嶈鎵ц鐨勪唬鐮佸潡锛岃捣鍒? 鍑忓寘浣滅敤
  • 銆岀紦瀛樹紭鍖栥€?/strong>锛氬湪寮€鍚枃浠跺搱甯屽寲鍚庯紝鏍规嵁鏂囦欢鍝堝笇鍊兼槸鍚﹀彂鐢熷彉鍖栨墽琛屾瀯寤烘搷浣滐紝鍝堝笇鏃犲彉鍖栫殑鏂囦欢鐩存帴浠庣紦瀛樹腑鑾峰彇锛屽噺灏戞瀯寤虹敓鎴愭枃浠剁殑鏃堕棿
  • 銆岀紦瀛樻枃浠躲€?/strong>锛氶娆℃瀯寤洪€熷害鍙兘鎱竴浜涳紝鏋勫缓瀹屾垚鍚庝細鐢熸垚鏈湴缂撳瓨鏂囦欢锛屽彲鎻愰珮鍚庣画鍐嶆鏋勫缓鐨勯€熷害
  • 銆屽搱甯屾枃浠躲€?/strong>锛氬彲瀵圭敓鎴愭枃浠惰缃搱甯屽€硷紝鍙湁鏂囦欢鍐呭淇敼鎵嶄細鏇存敼鍝堝笇鍊硷紝鐢ㄤ簬闀跨紦瀛樹紭鍖?
  • 銆屾椂鍖栫洰褰曘€?/strong>锛氬彲鏃堕棿搴忓垪鍖栧懡鍚嶈緭鍑虹殑椤圭洰鏍圭洰褰曪紝澧炲姞鏃堕棿鎴冲尯鍒嗙増鏈?
  • 銆屽垎鏋愭瀯寤恒€?/strong>锛氬彲鍦ㄦ瀯寤哄畬鎴愬悗灞曠ず鏋勫缓渚濊禆鐨勫叧绯伙紝鏍规嵁鍏崇郴鍥惧悎鐞嗗垎鏋愭ā鍧楃殑渚濊禆鍏崇郴
  • 銆屼笂浼犳枃浠躲€?/strong>锛氭毚闇插嚭鏋勫缓鎴愬姛鐨勯挬瀛愶紝鍙湪閽╁瓙鍑芥暟涓婄紪鍐欎笂浼犲埌鏈嶅姟鍣ㄧ殑浠g爜鐢ㄤ簬鏋勫缓鍚庡皢鏂囦欢涓婁紶鍒版湇鍔″櫒锛岃繕鍙繘琛屽叾浠栨搷浣?
  • 銆屽畾鍒堕厤缃€?/strong>锛氬綋閮ㄥ垎閰嶇疆涓嶇鍚堥」鐩渶姹傛椂锛屽彲閫氳繃椤圭洰鏍圭洰褰曚笅鐨勯厤缃枃浠? brucerc.js淇敼榛樿閰嶇疆锛屾瀯寤哄惎鍔ㄦ椂灏变細浣跨敤璇ラ厤缃枃浠惰鐩栭粯璁ゆ瀯寤洪厤缃?

鈿欙笍閰嶇疆

  • 銆宎lias銆?/strong>锛氭ā鍧楀鍏ュ揩鎹锋柟寮忥紝閰嶇疆璇︽儏璇峰弬鑰僿ebpack-resolve-alias
  • 銆宐rowserList銆?/strong>锛氱洰鏍囨祻瑙堝櫒閰嶇疆鍒楄〃锛岄厤缃鎯呰鍙傝€僢rowserslist
  • 銆宔rrorCb(err)銆?/strong>锛氭瀯寤哄け璐ュ洖璋冨嚱鏁帮紝鍙嚜瀹氬叾浠栨搷浣?
    • err锛氶敊璇俊鎭?
  • 銆宔slintIgnores銆?/strong>锛欵slint蹇界暐璺緞鍒楄〃锛岄厤缃鎯呰鍙傝€僥slint-ignores
  • 銆宔slintRules銆?/strong>锛欵slint鏍¢獙瑙勫垯鍒楄〃锛岄厤缃鎯呰鍙傝€僥slint-rules鍜宺ules
  • 銆宖rame銆?/strong>锛氬紑鍙戞鏋? default琛ㄧず鏅€氬簲鐢紝 react琛ㄧずReact搴旂敤锛? vue琛ㄧずVue搴旂敤)
  • 銆宨ncludeModules銆?/strong>锛氱紪璇戞ā鍧楃櫧鍚嶅崟鍒楄〃( node_modules/xxx)锛岄粯璁や笉瀵? node_modules缂栬瘧
  • 銆宱penPath銆?/strong>锛氬紑鍙戠幆澧冧笅娴忚鍣ㄦ墦寮€鍚庢樉绀篣RL璺緞
  • 銆宲roxy銆?/strong>锛氭帴鍙d唬鐞嗭紝閰嶇疆璇︽儏璇峰弬鑰僿ebpack-dev-server-proxy
  • 銆宻tyle銆?/strong>锛氭牱寮忔牸寮? scss/less)
  • 銆宻tylelintIgnores銆?/strong>锛歋tylelint蹇界暐璺緞鍒楄〃锛岄厤缃鎯呰鍙傝€僺tylelint-ignores
  • 銆宻tylelintRules銆?/strong>锛歋tylelint鏍¢獙瑙勫垯鍒楄〃锛岄厤缃鎯呰鍙傝€僺tylelint-rules鍜宺ules
  • 銆宻uccessCb(mode, dir)銆?/strong>锛氭瀯寤烘垚鍔熷洖璋冨嚱鏁帮紝鍙嚜瀹氫箟涓婁紶鏂囦欢鎿嶄綔鎴栧叾浠栨搷浣?
    • mode锛氳繍琛岀幆澧? test琛ㄧず娴嬭瘯鐜锛? prod琛ㄧず鐢熶骇鐜)
    • dir锛氳緭鍑鸿矾寰?
  • 銆寀ploadOpts(mode)銆?/strong>锛氫笂浼犻厤缃嚱鏁?蹇呴』杩斿洖涓€涓? 銆孫bject銆?/strong>锛屽苟鍖呭惈浠ヤ笅瀛楁)锛岄厤缃鎯呰鍙傝€僺cp2
    • host锛氭湇鍔″櫒IP鍦板潃
    • password锛氬瘑鐮?涓嶅彲涓? privateKey鍏卞瓨)
    • path锛氱洰鏍囨枃浠惰矾寰?
    • privateKey锛氱閽?涓嶅彲涓? password鍏卞瓨)
    • username锛氳处鍙?
    • mode锛氳繍琛岀幆澧? test琛ㄧず娴嬭瘯鐜锛? prod琛ㄧず鐢熶骇鐜)
    • 鍥炶皟鍙傛暟
    • 杩斿洖瀵硅薄
  • 銆寀seTs銆?/strong>锛氶泦鎴怲ypeScript

榛樿閰嶇疆

module.exports = {
    alias: {},
    browserList: [
        "last 20 Chrome versions",
        "last 20 Firefox versions",
        "last 20 Opera versions",
        "Explorer >= 10",
        "Safari >= 8",
        "android >= 5",
        "ios >= 8"
    ],
    errorCbnull,
    eslintIgnores: [],
    eslintRules: {
        // eslint瑙勫垯閰嶇疆
        // 鏌ョ湅bruce-cli妯″潡涓嬬殑temp/configs/eslintrc.{default/react/vue}.js
    },
    frame"default",
    includeModules: [],
    openPath"",
    proxy: {},
    style"scss",
    stylelintIgnores: [],
    stylelintRules: {
        // stylelint瑙勫垯閰嶇疆
        // 鏌ョ湅bruce-cli妯″潡涓嬬殑temp/configs/stylelintrc.{default/react/vue}.js
    },
    successCbnull,
    uploadOptsnull,
    useTsfalse
};

瑕嗙洊閰嶇疆

  • 鐩墠鍙彁渚? .js褰㈠紡鐨勯厤缃枃浠讹紝鍙弬鑰冧互涓嬮厤缃紪鍐?
  • 鍥犱负鏈」鐩娇鐢? CommonJS瑙勮寖寮€鍙戯紝鎵€浠ュ繀椤讳娇鐢? module.exports = { ... };瀵煎嚭浠ヤ笅閰嶇疆
  • 濡傞渶鑷畾涔変笂浼犳搷浣滐紝蹇呴』鎶? uploadOpts璁剧疆涓? null鎴栧垹闄よ瀛楁锛屽苟浣跨敤 successCb瀹氫箟涓婁紶鎿嶄綔
module.exports = {
    alias: {
        swiper"swiper/dist/js/swiper.js"
    },
    browserList: [
        "> 0.5%",
        "last 2 versions"
    ],
    errorCb(err) {
        console.log("閿欒淇℃伅", err);
    }
    eslintIgnores: [
        "src/components/*"
    ],
    eslintRules: {
        "space-before-function-paren": ["error""always"]
    },
    frame"react",
    includeModules: [
        "lodash",
        "trample"
    ],
    openPath"?abc=123",
    proxy: [{
        changeOrigintrue,
        context: [
            "/login",
            "/list",
            "/detail"
        ],
        securefalse,
        target"https://www.baidu.com"
    }],
    style"less",
    stylelintIgnores: [
        "src/assets/css/*"
    ],
    stylelintRules: {
        "color-hex-case""upper"
    },
    successCb(mode, dir) {
        console.log("杩愯鐜", mode);
        console.log("杈撳嚭璺緞", dir);
    },
    uploadOpts(mode) {
        return {
            host"your server ip",
            password"your server password",
            path"/root/www",
            username"root"
        };
    },
    useTstrue
};

馃搵缁嗚妭

IDE鐩稿叧

  • 鎺ㄨ崘浣跨敤VSCode寮€鍙戦」鐩紝浠ヤ笅閰嶇疆涔熸槸鍩轰簬 VSCode椹卞姩
  • 鑻ュ惎鐢? Stylelint鎴? Eslint锛岄渶鍦↖DE涓婂畨瑁匰tylelint鎻掍欢鍜孍slint鎻掍欢鎵嶈兘閰嶅悎鏈」鐩牎楠屼唬鐮佸苟楂樹寒鏄剧ず璀﹀憡鍜岄敊璇?
  • Stylelint鎴? Eslint鐨勮缁嗛厤缃彲鍙傝€冪瑪鑰呯殑寮€婧愰」鐩畍scode-lint

CLI鐩稿叧

  • 榛樿鏄剧ず璇█涓? 绠€浣撲腑鏂?/code>锛屽闇€鍒囨崲 绻佷綋涓枃/鑻辨枃璇锋墽琛? bruce l鍒囨崲
  • 鐩墠鍙澶囦簡 React鍜? Vue鐨勬瀯寤洪厤缃紝璇峰嬁鏋勫缓 Angular鎴栧叾浠? MVVM椤圭洰
  • 褰撳墠搴旂敤鍙兘鏄? React搴旂敤鎴? Vue搴旂敤鎵嶈兘浣跨敤 bruce n鍛戒护
  • 閰嶇疆鏂囦欢 brucerc.js鐨勫睘鎬ф槸 null/""/[]/{}鏃讹紝浼氫娇鐢ㄥ唴缃厤缃粯璁ゅ€?
  • 璇峰姟蹇呴伒寰瀯寤洪敊璇彁绀轰慨姝g浉鍏抽敊璇紝涓嶈闅忔剰鏀瑰姩鏋勫缓婧愮爜鍜岀敓鎴愰厤缃紝鍚﹀垯鍙兘瀵艰嚧椤圭洰鏋勫缓杩涚▼鏃犳硶杩愯
  • 澶氭鏋勫缓鍚庡彲鑳藉洜涓洪暱鏃堕棿浣跨敤闀跨紦瀛樹紭鍖栵紝瀵艰嚧缂撳瓨鏈夊嚑鐜囪鍙栧け璐ワ紝閲嶆柊鏋勫缓鏃跺彲鑳戒細鎻愮ず閿欒锛屾鏃舵墽琛? bruce r鍒犻櫎 node_modules骞堕噸鏂板畨瑁呬緷璧栧嵆鍙?

鏂囦欢鐩稿叧

  • 椤圭洰鍙兘鍗曠嫭瀛樺湪JS鎴朤S锛孞S椤圭洰鑴氭湰鏂囦欢鍙兘鏄? .js/.jsx/.vue锛孴S椤圭洰涓嬭剼鏈枃浠跺彧鑳芥槸 .ts/.tsx/.vue
  • 搴旂敤绫诲瀷涓篠PA鏃讹紝鍏ュ彛鏂囦欢蹇呴』涓? src/index.(js|ts|jsx|tsx)
  • 搴旂敤绫诲瀷涓篗PA鏃讹紝鍏ュ彛鏂囦欢蹇呴』涓? src/pages/pageName/index.(js|ts|jsx|tsx)
  • 褰? src/pages鐩綍瀛樺湪涓斿寘鍚瓙鏂囦欢澶癸紝鍒欒嚜鍔ㄨ瘑鍒负 MPA椤圭洰
  • 浣跨敤 CSS绮剧伒鍥?/code>鏃讹紝蹇呴』鎶婂浘鏍囩粺涓€鏀惧埌 src/assets/icon涓嬶紝涓旀枃浠舵牸寮忎负 png
  • 鏆撮湶鍑哄叏灞€鍙橀噺 RUN_ENV鐢ㄤ簬鑾峰彇褰撳墠杩愯鐜锛屽湪浣跨敤 Eslint浼氭姤璇硶閿欒锛屽湪浠g爜鍚庨潰杩藉姞 // eslint-disable-line鍗冲彲
    • dev锛氬紑鍙戠幆澧?
    • test锛氭祴璇曠幆澧?
    • prod锛氱敓浜х幆澧?
  • 鏂囦欢瀵煎叆蹇嵎鏂瑰紡
    • #锛氭牴鐩綍
    • @锛? src鐩綍

鍨墖鐩稿叧

  • @babel/polyfill鍦? 7.4.0鍚庤寮冪敤锛屽洜姝ゆ湰椤圭洰浣跨敤鐨勫灚鐗囦负 core-js鍜? regenerator-runtime
  • 濡傛棤鐗规畩鍏煎锛屽叆鍙f枃浠舵渶椤跺鏃犻渶鎻掑叆 import "core-js/stable";鍜? import "regenerator-runtime/runtime";锛屾瀯寤虹▼搴忎細鑷鏍规嵁棰勮鐜鍜? browserslist澧炲姞鍨墖
  • 濡傞渶鍏煎浣庣増鏈祻瑙堝櫒锛岄渶鎵嬪姩瀹夎 core-js鍜? regenerator-runtime锛屽湪鍏ュ彛鏂囦欢鏈€椤跺鎻掑叆 import "core-js/stable";鍜? import "regenerator-runtime/runtime";

ES6鐩稿叧

  • 鎵ц bruce b鏋勫缓椤圭洰鏃讹紝鑻ユ槸棣栨鏋勫缓浼氭彁绀烘瀯寤? package.json涓? dependencies鐨勪緷璧? Dll鏋勫缓)锛岀洰鐨勬槸鍔犲揩鍚庣画寮€鍙戜腑 HMR鐨勬瀯寤洪€熷害锛屽彧鏋勫閲忓缓淇敼杩囩殑鏂囦欢锛屽叾浣欐枃浠朵竴姒傝鍙栫紦瀛?
  • 鑻ユ煇涓緷璧栦娇鐢‥SM鎸夐渶瀵煎叆锛屽湪鎵ц bruce b鏋勫缓椤圭洰鏃朵笉瑕侀€夋嫨璇ヤ緷璧栧姞鍏ュ埌 Dll鏋勫缓涓紝骞跺湪 brucerc.js鐨? includeModules涓婂鍔犺渚濊禆锛屾瀯寤烘椂浼氬幓闄や笉琚紩鐢ㄦ垨涓嶈鎵ц鐨勪唬鐮佸潡

TS鐩稿叧

  • 褰撲娇鐢═S鏃讹紝浼氬湪椤圭洰鏍圭洰褰曚笅鑷姩鐢熸垚閰嶇疆鏂囦欢 tsconfig.json
  • 濡傞渶淇敼TS閰嶇疆锛屽彧闇€淇敼 tsconfig.json

鏅€氶」鐩浉鍏?bruce i鍒濆椤圭洰鏃堕€夋嫨default)

  • 鍙娇鐢ㄥ唴缃? handlebars妯℃澘
  • 鍏ュ彛鏂囦欢蹇呴』涓? src/index.js鎴? src/pages/pageName/index.js
  • 鍒濆鏃剁殑搴旂敤绫诲瀷涓篠PA(涓嶆彁渚汳PA褰㈠紡鐨勫垵濮嬪寲)锛屽闇€杞崲鎴怣PA锛屽繀椤绘寜鐓у熀纭€椤圭洰瑙勫畾鐨勫叆鍙f枃浠跺舰寮忛噸鏂板垎閰嶆枃浠惰矾寰?
  • 鍙敤鏉ュ紑鍙戝師鐢烰S椤圭洰銆丣query椤圭洰鍜孼epto椤圭洰绛?
  • 鍏叡鍑芥暟闇€鏀剧疆 src/templates/helpers鐩綍涓嬶紝鍦ㄦā鏉垮唴浣跨敤 {{> fileName}}寮曠敤
  • 鍏叡妯℃澘闇€鏀剧疆 src/templates/partials鐩綍涓嬶紝鍦ㄦā鏉垮唴浣跨敤 {{fileName param}}寮曠敤
  • 鍏叡鍑芥暟鍜屽叕鍏辨ā鏉跨殑鐢ㄦ硶鍜岀ず渚嬭鍙傝€僪andlebars-loader

鈿栵笍瀵规瘮

Github涓婂父瑙佺殑鏋勫缓椤圭洰閮芥槸鏆撮湶鍑哄緢澶氭瀯寤轰唬鐮侊紝鏋勫缓浠g爜鍜屼笟鍔′唬鐮佸畬鍏ㄨ€﹀悎鍦ㄤ竴璧凤紝瀵艰嚧缁存姢鍜屽崌绾ф垚鏈姞閲嶏紝閲嶆柊寮€涓€涓」鐩繕鏄細閬囧埌璇ラ棶棰樸€?/p>

鏈」鐩氨鏄惧緱姣旇緝鐗规畩锛岀湡姝e疄鐜版瀯寤轰唬鐮佸拰涓氬姟浠g爜鐨勫畬鍏ㄥ垎绂伙紝浠?code class="mq-778">NPM妯″潡鐨勫舰寮忛攣瀹氭瀯寤轰唬鐮侊紝鍙€氳繃涓€涓厤缃枃浠朵笌涓氬姟浠g爜閫氳锛岃寮€鍙戣€呰В鏀惧弻鎵嬶紝鍙渶鍐欏ソ涓氬姟浠g爜銆?/p>

浠ヤ笅瀵逛紶缁熸瀯寤烘柟妗堝拰鏈瀯寤烘柟妗堣繘琛屼竴娆″悎鐞嗙殑瀵规瘮

  • 浼犵粺鏋勫缓鏂规
  • 鏈瀯寤烘柟妗?

浼犵粺鏋勫缓鏂规

鍩轰簬Gulp/Webpack鏋勫缓鐨?code class="mq-789">React/Vue椤圭洰锛岄」鐩唬鐮佸垎涓?span class="mq-790">銆屾瀯寤轰唬鐮併€?/strong>鍜?span class="mq-791">銆屼笟鍔′唬鐮併€?/strong>锛岄」鐩洰褰曞拰鏂囦欢閰嶇疆鏄瘮杈冧紶缁熷拰澶氫汉浣跨敤鐨勯」鐩惌寤烘柟妗堛€傛暣涓」鐩腑闄ゅ幓涓氬姟浠g爜鍚庯紝鏋勫缓浠g爜鐨勬枃浠惰緝澶氾紝閰嶇疆姣旇緝鍒嗘暎锛岃緝闅鹃泦涓鐞嗭紝鏃犳硶鍋氬埌寮€绠卞嵆鐢紝閫氱敤鎬ц緝浣庯紝鍓嶆湡鎼缓椤圭洰鏋勫缓鏂规鍙兘鑺辫垂鐨勬椂闂磋緝澶氾紝椤圭洰鏋勫缓鏃堕渶渚濊禆鏈」鐩瓨鍦ㄧ殑渚濊禆妯″潡鎵嶈兘椹卞姩銆傚浜庡鍒犳敼鏋勫缓鍔熻兘鍜屾柊鍚屼簨鍏ラ棬锛屽彲鑳介渶鑺辫緝澶氱殑鏃堕棿鍘绘煡鎵句唬鐮佸拰鐔熸倝鏋勫缓閫昏緫銆?/p>

鎺ㄨ崘涓€涓浂閰嶇疆寮€绠卞嵆鐢ㄧ殑React/Vue搴旂敤鑷姩鍖栨瀯寤鸿剼鎵嬫灦锛屼笉寮哄ぇ浣犳潵鎵炬垜
浼犵粺鏋勫缓鏂规鐩綍

鏈瀯寤烘柟妗?/p>

鍩轰簬鏈」鐩瀯寤虹殑React/Vue椤圭洰锛屼唬鐮佸彧鏈?span class="mq-799">銆屼笟鍔′唬鐮併€?/strong>锛屾瀯寤轰唬鐮侀泦涓湪涓€璧峰仛鎴愪竴涓?code class="mq-800">NPM妯″潡骞跺畨瑁呭埌鍏ㄥ眬鐜涓紝閫氳繃鍛戒护璋冪敤鏈柟妗堥┍鍔ㄩ渶寮€鍙戠殑椤圭洰锛屽疄鐜版瀯寤轰唬鐮佸拰涓氬姟浠g爜瀹屽叏鍒嗙銆傚紑鍙戞椂鏃犻渶鍏虫敞濡備綍鍐欏ソ鏋勫缓浠g爜鍜屼娇鐢ㄤ綍绉嶅伐鍏锋墿灞曟瀯寤哄姛鑳斤紝鍙渶涓撴敞浜庝笟鍔′唬鐮佺殑缂栧啓锛屾暣涓」鐩彧瀛樺湪涓氬姟浠g爜锛屽彲閫氳繃閰嶇疆鏂囦欢淇敼榛樿鏋勫缓閰嶇疆锛屽ぇ澶х缉鍑忛」鐩墠鏈熺殑鍑嗗宸ヤ綔锛屼繚璇侀」鐩殑銆岀畝娲佹€с€?/strong>銆?span class="mq-802">銆岀嫭绔嬫€с€?/strong>銆?span class="mq-803">銆岄珮鏁堟€с€?/strong>鍜?span class="mq-804">銆岀淮鎶ゆ€с€?/strong>銆傜渷鍘婚」鐩墠鏈熸惌寤虹殑鏃堕棿锛岀洿鎺ュ紑绠卞嵆鐢紝浣垮紑鍙戣€呴泦涓簿鍔涘啓濂戒笟鍔′唬鐮併€?/p>

鏈瀯寤烘柟妗堢洰褰?

鏂规瀵规瘮

~ 浼犵粺鏋勫缓鏂规 鏈瀯寤烘柟妗?/th>
鏋勫缓鏂囦欢 build鏂囦欢澶?/code>銆?code class="mq-820">config鏂囦欢澶?/code>
.browserslistrc
.postcssrc銆?code class="mq-825">babelrc

.stylelintignore銆?code class="mq-828">.stylelintrc
.eslintignore銆?code class="mq-831">.eslintrc
鏃?/td>
涓氬姟鏂囦欢 src鏂囦欢澶?/code> src鏂囦欢澶?/code>
閰嶇疆鏂囦欢 寰堝锛岄渶鍒嗗紑涔﹀啓 brucerc.js
鍩虹鏂囦欢 package.json銆?code class="mq-848">readme.md package.json銆?code class="mq-851">readme.md
渚濊禆妯″潡 Webpack/Gulp鎶€鏈爤(鏋勫缓)
React/Vue鎶€鏈爤(涓氬姟)
React/Vue鎶€鏈爤(涓氬姟)
瀹夎鏃堕棿 杈冩參
瀹夎鏋勫缓鍜屼笟鍔′唬鐮佺殑渚濊禆妯″潡
姣忔寮€鍙戦兘闇€瀹夎涓€娆?/td>
杈冨揩
鍙畨瑁呬笟鍔′唬鐮佺殑渚濊禆妯″潡
鍏ㄥ眬瀹夎涓€娆″嵆鍙?/td>
寮€鍙戝噯澶?/td> 缂栧啓Webpack/Gulp鍜屽绉嶅伐鍏锋惌閰嶇殑鏋勫缓浠g爜 寮€绠卞嵆鐢?/td>
鍏ㄥ眬浣跨敤 涓嶅彲琛?/td> 鍙
鏋勫缓澶嶇敤 鏂板缓鏂囦欢澶癸紝澶嶅埗绮樿创鏋勫缓浠g爜锛屼慨鏀归厤缃枃浠剁瓑 鎵ц鍛戒护琛屽垵濮嬮」鐩拰鏋勫缓椤圭洰
鏂版墜鏋勫缓 闇€浜嗚В鏋勫缓浠g爜閫昏緫鍜岄厤缃枃浠?/td> 鎵ц鍛戒护琛?/td>
鍚庢湡鎵╁睍 鍦ㄥ師鏈夋瀯寤轰唬鐮佷腑澧炲垹鏀规瀯寤哄姛鑳?/td> 閫氳繃閰嶇疆鏂囦欢brucerc.js澧炲垹鏀规瀯寤哄姛鑳?/td>
閰嶇疆绠$悊 鍒嗘暎鍒颁笉鍚岀殑鏋勫缓閰嶇疆鏂囦欢涓?br class="mq-892">闇€瀵逛笉鍚屽伐鍏风殑閰嶇疆鏂囦欢淇敼 闆嗘垚鏋勫缓鐨勫熀纭€閰嶇疆
鍙€氳繃閰嶇疆鏂囦欢brucerc.js瑕嗙洊

馃敤绀轰緥

浠ヤ笅鏄竴涓畬鏁寸殑椤圭洰寮€鍙戞祦绋嬶細

  • 鏌ョ湅甯姪锛? bruce -h
  • 鏌ョ湅鐗堟湰锛? bruce -v
  • 鍒囨崲璇█锛? bruce l
  • 杩涘叆鏂囦欢澶癸細 cd projectList
  • 鍒濆椤圭洰锛? bruce i
  • 杩涘叆椤圭洰鏍圭洰褰曪細 cd myProject
  • 鏋勫缓椤圭洰锛? bruce b
  • 鍒涘缓缁勪欢(澶勪簬寮€鍙戠姸鎬佹椂闇€鍙﹁捣涓€涓? cmd绐楀彛鎵ц)锛? bruce n
  • 鍙戝竷椤圭洰(澶勪簬寮€鍙戠姸鎬佹椂闇€鍙﹁捣涓€涓? cmd绐楀彛鎵ц)锛? bruce b
  • 鍒犻櫎渚濊禆(鍑虹幇鏋勫缓澶辫触鎴栧叾浠栫獊鍙戞儏鍐?锛? bruce r

姝g‘浣跨敤濮垮娍璇风湅杩欎釜瑙嗛锛岀畝鍗曟槗鐢ㄦ柟渚垮揩鎹凤紝銆屼竴娆″畨瑁呭叏灞€杩愯銆?/strong>锛屽疄鍦ㄦ槸銆岃繙绂绘灦鏋勪笓娉ㄧ紪鐮佺殑蹇呭宸ュ叿銆?/strong>銆?/p>

绗旇€呯殑涓汉瀹樼綉浣跨敤bruce-cli鏋勫缓锛屽彲褰撳仛bruce-cli绀轰緥锛屾湁鍏磋叮鐨勫悓瀛﹁鎴矹owayYoung涓汉瀹樼綉鏌ョ湅璇︽儏銆?/p>

馃敄鐗堟潈

MIT 漏 Joway Young

鏈」鐩敱绗旇€呯嫭鑷紑鍙戯紝鍏ㄧ▼鏃犱换浣曚汉鍙備笌锛岀粡杩?骞村鐨勬椂闂存矇娣€鍑烘潵锛屾暣涓繃绋嬭繘琛屼簡澶ч噺鐨勯」鐩祴璇曞拰搴旂敤锛岀洰鍓嶄笂绾跨殑椤圭洰澶氳揪50澶氫釜锛岃冻鍙敮鎾戞湰椤圭洰鐨勫彲琛屾€у拰绋冲畾鎬с€?/p>

鐢变簬鑷繁椤圭洰寮€鍙戠粡楠屽拰鎶€鏈Н绱湁闄愶紝涓嶈兘淇濊瘉鏈」鐩笉瀛樺湪浠讳綍Bug锛岃嫢鍦ㄥ悗缁娇鐢ㄦ湰椤圭洰鏃跺彂鐜癇ug鎴栦骇鐢熺枒闂紝鍙殢鏃跺湪Issues涓婃彁鍑轰綘鐨勫疂璐靛缓璁紝绗旇€呬細绔嬮┈鍙嶉鍜屼慨澶嶇浉鍏矪ug銆?/p>

鈴冲悗璁?/span>

鏈」鐩簮浜?code class="mq-947">2017骞?鏈?/code>绗旇€呰礋璐d竴涓?code class="mq-948">Angular2椤圭洰閲岀殑鏋勫缓浠g爜锛屼粠鏈€鍒濈殑Webpack2涓€鐩磋凯浠e埌浠婂ぉ鐨?code class="mq-950">Webpack4锛岃瘽璇?code class="mq-951">Webpack5杩囨鏃堕棿灏辫鍙戝竷浜嗐€?/p>

鏈€鍒濈瑪鑰呯殑鏋勬€濇槸鍐欎竴浠芥瀯寤轰唬鐮佹ā鏉垮瓨鏀惧湪Github涓婏紝鐒跺悗閫氳繃鑴氭湰鎶婃瀯寤轰唬鐮佹媺涓嬫潵銆傚彲鏄繖鏍锋瀯寤轰唬鐮佸拰涓氬姟浠g爜杩樻槸鍚屾椂瀛樻斁鍦ㄤ竴涓枃浠跺す閲岋紝涓嶆槗绠$悊锛屾枃浠跺張澶氬張鏉傘€備笅娆℃柊寮€椤圭洰鏃跺張瑕佹妸鏋勫缓浠g爜澶嶅埗杩囧幓锛屾湁鏃跺崌绾ф瀯寤哄姛鑳斤紝涓轰簡淇濇寔鏋勫缓鍔熻兘鐨勭粺涓€锛岄渶鍚屾椂淇敼鍑犱釜椤圭洰閲岀殑鏋勫缓浠g爜銆傛棦鐒惰繖鏍凤紝涓轰綍涓嶆妸閭d簺閫氱敤鐨勬瀯寤轰唬鐮佹娊绂诲嚭鏉ュ仛鎴愪竴涓狽PM妯″潡鍛紝杩欐牱銆屼竴娆″畨瑁呭叏灞€銆?/strong>杩愯锛屽鐖藉憖锛?/p>

2017骞?鏈?/code>绗旇€呭氨寮€濮嬪杩欎釜椤圭洰鍗囩骇鏀归€狅紝鍋氭垚涓€涓狽PM妯″潡锛屽彧涓嶈繃涓€鐩村湪鑷繁璐熻矗鐨勯」鐩笂搴旂敤銆傚洜涓鸿繕娌℃€庢牱搴旂敤鍒板叾浠栫殑椤圭洰涓婏紝鎵€浠ヤ篃涓嶆暍寮€婧愩€傜粡杩囧樊涓嶅1骞村ぇ澶у皬灏?0澶氫釜椤圭洰鐨勫簲鐢紝缁堜簬绋冲畾浜嗚繖涓」鐩殑鍔熻兘锛屾墍浠ョ瑪鑰呬篃鍐冲畾瀵?code class="mq-957">bruce-cli寮€婧愩€傚浜庢墍鏈夐€氳繃bruce-cli鍒涘缓鐨勯」鐩兘鍙紑绠卞嵆鐢ㄦ墍鏈夌殑鏋勫缓鍔熻兘锛屽鏃犵壒娈婇渶姹傜敋鑷虫槸闆堕厤缃嵆鍙繍琛岄」鐩€?/p>

寮€鍙戣繖涓」鐩粡鍘嗕簡寰堝锛屾寲鐨勫潙寰堝锛屽~鐨勫潙涔熷緢澶氾紝寰堣嫤寰堢疮锛屾湁娈垫椂闂磋繕缁忓父鐔灏辨槸涓轰簡鎶婂畠鍋氬緱鏇村ソ銆備笉杩囨敹鑾蜂篃寰堝ぇ锛屽涔犱簡寰堝鏂扮煡璇嗘柊鎶€鑳斤紝鎶婂父鐢ㄧ殑Node鐭ヨ瘑閮界敤涓婁簡锛屼篃涓鸿嚜宸卞悗鏈熷仛Node搴旂敤寮€鍙戞墦涓嬩簡宸╁浐鐨勫熀纭€銆傛湁浠樺嚭灏辨湁鏀惰幏锛岀瑪鑰呰繕鏄竴鐩存繁淇¤繖鍙ヨ瘽锛屽洜涓鸿嚜宸辩‘瀹炶繘姝ヤ簡寰堝銆傛埅姝?020骞达紝宸叉垚鍔熻繍鐢ㄥ湪鑷繁鎵€璐熻矗鐨勯」鐩揪鍒?code class="mq-960">50澶氫釜锛屽啀鍔犱笂涓€浜涘悓琛屾湅鍙嬪拰涓€浜涘皬鍏徃涔熸湁浣跨敤鏈」鐩€?/p>

鏈」鐩熀浜?code class="mq-962">Node12+寮€鍙戯紝涓轰簡鍏煎Node10+锛屾墍浠ヤ娇鐢?code class="mq-964">babel缂栬瘧浜嗘簮鐮侊紝鐢熸垚鐜板湪绾夸笂鐗堟湰鐨勪唬鐮侊紝寰呮洿澶氱殑椤圭洰娴嬭瘯瀹屾垚鍜屽簲鐢ㄨ捣鏉ュ悗浼氬紑鏀炬簮鐮佷緵澶у涓€璧峰涔犲拰瀹屽杽銆?/p>

鑻ヨ寰?code class="mq-966">bruce-cli瀵逛綘鏈夊府鍔╋紝鍙湪Issue涓?code class="mq-967">鎻愬嚭浣犵殑瀹濊吹寤鸿锛岀瑪鑰呬細璁ょ湡闃呰骞舵暣鍚堜綘鐨勫缓璁€傚枩娆?code class="mq-968">bruce-cli鐨勮缁欎竴涓猄tar锛屾垨Fork鏈」鐩埌鑷繁鐨?code class="mq-969">Github涓婏紝鏍规嵁鑷韩闇€姹傚畾鍒跺姛鑳姐€?/p>



鎺ㄨ崘闃呰   鐐瑰嚮鏍囬鍙烦杞?/span>

1銆?/span>

2銆?/span>

3銆?/span>


瑙夊緱鏈枃瀵逛綘鏈夊府鍔╋紵璇峰垎浜粰鏇村浜?/span>

鎺ㄨ崘鍏虫敞銆屽墠绔ぇ鍏ㄣ€嶏紝鎻愬崌鍓嶇鎶€鑳?/span>

鐐硅禐鍜屽湪鐪嬪氨鏄渶澶х殑鏀寔鉂わ笍

以上是关于鎺ㄨ崘涓€涓浂閰嶇疆寮€绠卞嵆鐢ㄧ殑React/Vue搴旂敤鑷姩鍖栨瀯寤鸿剼鎵嬫灦锛屼笉寮哄ぇ浣犳潵鎵炬垜的主要内容,如果未能解决你的问题,请参考以下文章

R璇█涓嚑涓父鐢ㄧ殑鏁板鍔熻兘

linux涓父鐢ㄧ殑绯荤粺鍑芥暟

10涓潪甯稿疄鐢ㄧ殑 VS Code 鎻掍欢

闃舵涓€-02.鍒嗙被锛屾帹鑽愶紝鎼滅储锛岃瘎浠凤紝璐墿杞﹀紑鍙?绗?绔?鍟嗗搧鎺ㄨ崘+鎼滅储鍔熻兘瀹炵幇-2-1 鍟嗗搧鎺ㄨ崘 - 闇€姹傚垎鏋愪笌sql鏌ヨ

浣犲彲鑳戒笉鐭ラ亾鐨?5涓湁鐢ㄧ殑Github鍔熻兘