ü\Óü¿Æ¼¼Íø

 ÕÒ»ØÃÜÂë
 Á¢¼´×¢²á
mito
²é¿´: 1598|»Ø¸´: 8

[JavaScript] Webpack + Reactȫջ¹¤³Ì¼Ü¹¹ÏîĿʵս¾«½² ǰ¶Ë½ø½×¼Ü¹¹Ö®Â·ÊÓÆµ½Ì³Ì

[¸´ÖÆÁ´½Ó]

8Íò

Ö÷Ìâ

608

»ØÌû

27Íò

»ý·Ö

¹ÜÀíÔ±

Rank: 9Rank: 9Rank: 9

»ý·Ö
275170
QQ
·¢±íÓÚ 2018-5-12 13:54:04 | ÏÔʾȫ²¿Â¥²ã |ÔĶÁģʽ
¿Î³ÌÃû³Æ:   Webpack + Reactȫջ¹¤³Ì¼Ü¹¹ÏîĿʵս¾«½² ǰ¶Ë½ø½×¼Ü¹¹Ö®Â·ÊÓÆµ½Ì³Ì

¿Î³Ì¼ò½é:    

½Ì³Ì½«½Ì»áÄãÈçºÎ´ÓÒ»¸öǰ¶ËÒ»Ïß¿ª·¢×ªÐͼܹ¹¡£´Ó¼Ü¹¹µÄ½Ç¶È³ö·¢½éÉܸ߼¶Ç°¶ËÊÇÈçºÎ¹¤×÷ÒÔ¼°ÔÚ¼¼ÊõÑ¡ÐÍʱÈçºÎ¾ñÔñ´øÁìÍŶÓÍêÃÀЭ×÷¡£´Ó¹¤³Ì¼Ü¹¹ÔÙµ½ÏîÄ¿¼Ü¹¹È«·½Î»½ú¼¶¼Ü¹¹Ö®Â·¡£´ÓWebpack¡¢React¡¢MobxÔÙµ½·þÎñÆ÷äÖȾÊÐÃæÉÏ×î»ðÈȵĿò¼ÜºÍ¼¼Êõ¡£React16¡¢SSRÿ¸ö¾ßÌåϸ½Ú¶¼½«ÉîÈë½²½âͬʱ½«ÀýÈ翪·¢Öе÷ÊÔ·þÎñ¶ËäÖȾÀ§ÄѵÈÄÑÌâ¶¼Ò»Ò»½â´ð¡£¸ù¾Ý²»Í¬µÄÒµÎñÐèÇó´ïµ½×îÂúÒâµÄЧ¹û¡£ÔÙͨ¹ýʵսÏîĿһ²½Ò»²½ÈÃÄãѧ»á·þÎñ¶ËäÖȾ·½ÃæµÄ֪ʶÔÚÓ¦Óõ½ÄãµÄÏîÄ¿ÖС£

----------------------¿Î³ÌĿ¼------------------------------
1.¿Î³Ì½éÉÜ
ÎÒÃÇÖ÷Òª¶ÔÊÐÃæÉϲ»Í¬µÄǰ¶ËÏîÄ¿ÀàÐͽøÐÐÒ»¸ö¼òµ¥½éÉÜ£¬²¢Í¬Ê±½éÉܲ»Í¬ÀàÐ͵ÄÊʺÏÔõôÑùµÄ¼¼ÊõÑ¡ÐÍ¡£²¢ÇÒÎÒÃǶÔÏÖÔÚÖ÷Á÷µÄһЩǰ¶Ë¼¼ÊõÖðÒ»½øÐмòµ¥½éÉÜ£¬½²½âÆäÌØµãÒÔ¼°ÊʺϽâ¾öʲôÀàÐ͵ÄÎÊÌ⣬ϣÍûͬѧÃÇÄÜÔÚÕâÕÂÀïÃæ¶ÔÊÐÃæÉϵÄÖ÷Á÷ǰ¶ËÓÐÒ»¸ö´óÖµÄÁ˽⣬ÄܰïÖúÄã½ñºóÓöµ½²»Í¬µÄÀàÐ͵ÄÏîĿʱÅжϼ¼ÊõÑ¡ÐÍ¡£
2.¹¤³Ì¼Ü¹¹
ÎÒÃÇÕýʽ¿ªÊ¼´ÓÁ㿪ʼ´î½¨webappÏîÄ¿¡£Ê×ÏȽ¨Á¢×î»ù´¡µÄwebpackÅäÖã¬nodejs·þÎñ£¬webpack-dev-serverµÄÅäÖã¬ÒÔ¼°»ù´¡µÄ·þÎñ¶ËäÖȾÅäÖá£×îÖØÒªµÄÊÇÎÒÃÇÅäºÏwebpack£¬ÔÚ¿ª·¢Ê±ÓÃЧÂÊ×î¸ßµÄ·½Ê½Äõ½·þÎñ¶ËäÖȾµÄbundle£¬²¢¿ÉÒÔ·½±ãµØÔÚ¿ª·¢Ê±µ÷ÊÔ·þÎñ¶ËäÖȾµÄ´úÂë¡£
3.ÏîÄ¿¼Ü¹¹
ÎÒÃÇ¿ªÊ¼½øÐÐÏîÄ¿ÅäÖᣴÓReactµÄ»ù±¾£¬React-RouterºÍMobxµÄstore£¬²¢Íê³ÉÒ»¸ö¼òµ¥µÄǰ¶ËDemo¡£ÔÚ½øÐÐÍêÕâЩǰ¶ËÅäÖÃÖ®ºó£¬ÎÒÃÇÁªºÏ·þÎñ¶ËäÖȾ£¬ÔÚ·þÎñ¶ËÒ²¼ÓÈë·ÓÉÌø×ªºÍÊý¾Ý»ñÈ¡µÄ¹¦ÄÜ£¬´ïµ½»ù´¡µÄǰºó¶Ëͬ¹¹¡£Í¬Ê±ÎÒÃÇ»¹ÒªÁªµ÷CnodejsµÄ¿ª·ÅAPI£¬ÈÃÎÒÃǵÄÓ¦ÓÿÉÒÔ·ÃÎʵ½Êý¾Ý¡£
4.ÒµÎñ¿ª·¢
´ÓÕâÀ↑ʼÎÒÃǾͽøÈëÒµÎñ¿ª·¢µÄ»·½Ú¡£Ê×ÏÈÎÒÃÇҪʹÓÃMaterial-ui×é¼þ¿â£¬ÎÒÃÇÒªÅäÖÃ×é¼þ¿âµÄ·þÎñ¶ËäÖȾ£¬²¢Õ¹Ê¾×é¼þ¿âµÄ»ù±¾Ê¹Ó÷½·¨¡£È»ºóÎÒÃǽøÐÐÖ÷ÒªµÄÒµÎñ¿ª·¢£¬°üÀ¨»°ÌâÁÐ±í¡¢»°ÌâÏêÇé¡¢µÇ¼¡¢Óû§ÏêÇé¡¢»°Ìâ·¢²¼µÈ¹¦ÄÜ¡£×îºóÎÒÃÇÉý¼¶·þÎñ¶ËäÖȾ£¬ÈÃÓû§µÄµÇ¼״̬¿ÉÒÔÒ»Ö±±£³Ö¡£
5.ÏîÄ¿±àÒë´ò°üÉÏÏß
Ö÷Òª½²ÊöÕýʽ»·¾³µÄ´úÂë´ò°üºÍ²¿Êð¡£ÎÒÃÇ×î´óÏ޶ȵÃÓÅ»¯´úÂë´ò°ü£¬ÈÃÎÒÃÇÄÜ×î´óÏ޶ȵÃÀûÓÃä¯ÀÀÆ÷»º´æ¼Ó¿ìÓû§·ÃÎÊËÙ¶È¡£Æä´ÎÎÒÃǽ«´ò°üÍê³ÉµÄ´úÂëÉÏ´«µ½ÆßÅ£CDN£¬¼Ó¿ì¾²Ì¬×ÊÔ´µÄ¼ÓÔØËÙ¶È£¬²¢ÇÒÕâ¸öÉÏ´«¹ý³ÌÒ²×öµ½×Ô¶¯»¯¡£×îºóÎÒÃÇÀûÓÃnginxºÍpm2ÔÚ·þÎñÆ÷Éϲ¿ÊðÎÒÃǵÄÏîÄ¿£¬ÈÃÍâÍøÓû§¿ÉÒÔ·ÃÎÊÎÒÃǵÄÍøÕ¾¡£


ÏÂÔØµØÖ·£º
Óοͣ¬Èç¹ûÄúÒª²é¿´±¾ÌûÒþ²ØÄÚÈÝÇë»Ø¸´

¸ü¶àÌû×ÓÍÆ¼ö

»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

0

Ö÷Ìâ

1438

»ØÌû

3410

»ý·Ö

ÂÛ̳ԪÀÏ

Rank: 6Rank: 6

»ý·Ö
3410
QQ
·¢±íÓÚ 2018-5-12 17:19:18 | ÏÔʾȫ²¿Â¥²ã
010102020202020202
»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

0

Ö÷Ìâ

1Íò

»ØÌû

3Íò

»ý·Ö

ÌåÑéVIP

Rank: 7Rank: 7Rank: 7

»ý·Ö
31410
·¢±íÓÚ 2019-2-18 07:36:35 | ÏÔʾȫ²¿Â¥²ã
http://www.xunibaoku.com/forum.php?mod=post&action=reply&fid=355&tid=35695

»Ø¸´

ʹÓõÀ¾ß ¾Ù±¨

QQ|Archiver|ÊÖ»ú°æ|ü\Óü¿Æ¼¼Íø

GMT+8, 2025-11-29 22:06 , Processed in 0.188084 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí