HTML5¼¼Êõ

ASP.NET Core Web ×ÊÔ´´ò°üÓëѹËõ - Sweet-Tang

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2017-07-05 15:01 ÎÒÒªÆÀÂÛ( )

±¾ÎĽ«½éÉÜʹÓõĴò°üºÍѹËõµÄÓŵ㣬ÒÔ¼°ÈçºÎÔÚASP.NET CoreÓ¦ÓóÌÐòÖÐʹÓÃÕâЩ¹¦ÄÜ¡£ ¸ÅÊö ÔÚASP.NetÖпÉÒÔʹÓôò°üÓëѹËõÕâÁ½ÖÖ¼¼ÊõÀ´Ìá¸ßWebÓ¦ÓóÌÐòÒ³Ãæ¼ÓÔصÄÐÔÄÜ¡£Í¨¹ý¼õÉÙ´Ó·þÎñÆ÷ÇëÇóµÄ´ÎÊýºÍ¼õÉÙ×ÊÔ´ÎļþµÄÌå»ýÀ´Ìá¸ß¼ÓÔØÐÔÄÜ¡£ ´ò°üÊÇÒ»µØ½«¶à¸öÎÄ

±¾ÎĽ«½éÉÜʹÓõĴò°üºÍѹËõµÄÓŵ㣬ÒÔ¼°ÈçºÎÔÚASP.NET CoreÓ¦ÓóÌÐòÖÐʹÓÃÕâЩ¹¦ÄÜ¡£

¸ÅÊö

ÔÚASP.NetÖпÉÒÔʹÓôò°üÓëѹËõÕâÁ½ÖÖ¼¼ÊõÀ´Ìá¸ßWebÓ¦ÓóÌÐòÒ³Ãæ¼ÓÔصÄÐÔÄÜ¡£Í¨¹ý¼õÉÙ´Ó·þÎñÆ÷ÇëÇóµÄ´ÎÊýºÍ¼õÉÙ×ÊÔ´ÎļþµÄÌå»ýÀ´Ìá¸ß¼ÓÔØÐÔÄÜ¡£

  • ´ò°üÊÇÒ»µØ½«¶à¸öÎļþ£¨CSS£¬JavaScriptµÈ×ÊÔ´Îļþ£©ºÏ²¢»ò´ò°üµ½µ¥¸öÎļþ¡£ÎļþºÏ²¢¿É¼õÉÙÁË Web ×ÊÔ´Îļþ´Ó·þÎñÆ÷µÄËùÐèÇëÇóÊý£¬ÕâÑùÒ²¿ÉÌá¸ßÒ³ÃæÔØÈëµÄÐÔÄÜ¡£
  • ѹËõÊǽ«¸÷ÖÖ²»Í¬µÄ´úÂë½øÐÐÓÅ»¯£¬ÒÔ¼õÉÙÇëÇó×ÊÔ´ÎļþµÄÌå»ý¡£Ñ¹ËõµÄ³£¼û·½·¨É¾³ý²»±ØÒªµÄ¿Õ¸ñºÍ×¢ÊÍ£¬²¢½«±äÁ¿ÃûËõ¼õΪһ¸ö×Ö·û¡£
  • ÀýÈçÏÂÃæJavaScriptº¯Êý£º

    AddAltToImg imageElement ..)); }

    ѹËõºó£¬º¯Êý¼ò»¯ÎªÈçÏ£º

    AddAltToImgr..))};

    ³ýÁËɾ³ý×¢ÊͺͲ»±ØÒªµÄ¿Õ¸ñÖ®Í⣬²ÎÊýºÍ±äÁ¿Ãû³Æ±»ÖØÃüÃû£¨Ëõд£©ÈçÏ£º

    ԭʼÃû³Æ ÖØÃüÃûºó

    imageTagAndImageID t

    imageContext a

    imageElement r

    ´ËʾÀýÀ´×ÔÓÚgithub:https://github.com/aspnet/Docs/blob/master/aspnetcore/client-side/bundling-and-minification.md

    bundleconfig.jsonÎļþ

    MVCÏîÄ¿Ä£°åÌṩÁËÒ»¸öbundleconfig.jsonÅäÖÃÎļþ£¬Ëü¶¨ÒåÁË´ò°üµÄÅäÖÃÑ¡ÏĬÈÏÇé¿öÏ£¬ÊµÏÖÁË×Ô¶¨Òå½Å±¾Îļþ(wwwroot/js/site.js) ºÍÑùʽ±í (wwwroot/css/site.css) ÎļþµÄÅäÖá£

    [ [ "wwwroot/css/site.css" ] [ "wwwroot/js/site.js" ]]

    ÅäÖÃÑ¡ÏîÏêϸ˵Ã÷£º

  • ÊäÈë³öÎļþÀàÐÍ¿ÉÓÃÅäÖÃÑ¡Ïî¡£
  • includeInProject - ½«Éú³ÉµÄÎļþÌí¼Óµ½ÏîÄ¿¡£ Ñ¡Ì ĬÈÏÖµ - false
  • sourceMaps - Éú³ÉºÏ²¢ÎļþµÄÔ´ÎļþÓ³Éä¡£ Ñ¡ÌĬÈÏÖµ - false
  • ÔÚÏîÄ¿ÖÐʹÓôò°üºÍѹËõ

    ÔÚVS 2015/2017ÐèÒª°²×°BundlerMinifierVsix£¬°²×°Íê³ÉºóÐèÒªÖØÆôVS¡£

    ÔÚbundleconfig.jsonÎļþÓÒ¼üµ¥»÷£¬È»ºóÑ¡ÔñÈÎÎñÔËÐгÌÐò×ÊÔ´¹ÜÀíÆ÷¡£



    ÔÚUpdate all fielsÑ¡ÏîÓÒ¼üµ¥»÷£¬È»ºóÑ¡ÔñRun¡£



    ÔÚÏîÄ¿Öлá·Ö±ðÉú³ÉѹËõºóµÄ×ÊÔ´Îļþ¡£



    ÔÚÊÓͼÖÐʹÓôò°üѹËõºóµÄ×ÊÔ´Îļþ

    ÔÚÉÏһƪ²©¿Í¡¶ASP.NET CoreÅäÖû·¾³±äÁ¿ºÍÆô¶¯ÉèÖá·ÎÒÃÇÒѾ­ÌÖÂÛ¹ý»·¾³±äÁ¿£¬ÔÚÊÓͼÖÐͨ¹ý Environment ±êÇ©£¬·Ö±ð¶¨Ò忪·¢¡¢Ô¤ÑݺÍÉú²ú»·¾³¼ÓÔضÔÓ¦µÄ×ÊÔ´Îļþ¡£

    µ±ÔÚ¿ª·¢Ä£Ê½ÏÂÔËÐÐÓ¦ÓóÌÐò£¬ÎÒÃÇʹÓÃδѹËõCssºÍ½Å±¾Îļþ£»ÔÚÉú²ú»·¾³ÖУ¬ÎÒÃÇѹËõºóµÄ×ÊÔ´Îļþ£¬ÕâÑù¿ÉÒÔÌá¸ßÓ¦ÓóÌÐòµÄÐÔÄÜ¡£

    ×ܽá

    ÔÚASP.NetÖпÉÒÔʹÓôò°üÓëѹËõÕâÁ½ÖÖ¼¼ÊõÀ´Ìá¸ßWebÓ¦ÓóÌÐòÒ³Ãæ¼ÓÔصÄÐÔÄÜ¡£Ï£ÍûÉÏÃæµÄÄÚÈݶԴó¼ÒµÄѧϰÓÐËù°ïÖú£¬Ð»Ð»£¡
    ²Î¿¼:

  • https://github.com/aspnet/Docs/blob/master/aspnetcore/client-side/bundling-and-minification.md
  • https://www.codeproject.com/Articles/1158377/NET-Core-Startup
  • µÚÒ»´ÎʹÓÃMarkdownд²©¿Í£¬»¹²»ÊǺÜÏ°¹ß£¬ÅÅ°æ²»¹»ÕûÆ룬Çë´ó¼Ò¼ûÁ£¬Ð»Ð»£¡

    תÔØÇë×¢Ã÷³ö´¦£¬Ô­ÎÄÁ´½Ó£º

    ¡¡

    1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

    Ïà¹ØÎÄÕÂ
    • ASP.NET CoreÅäÖû·¾³±äÁ¿ºÍÆô¶¯ÉèÖà - Sweet-Tang

      ASP.NET CoreÅäÖû·¾³±äÁ¿ºÍÆô¶¯ÉèÖà - Sweet-Tang

      2017-07-05 09:03

    • ÎÒÑÛÖеÄASP.NET Core֮΢·þÎñ - Savorboard

      ÎÒÑÛÖеÄASP.NET Core֮΢·þÎñ - Savorboard

      2017-07-01 15:00

    • .NET Core 2.0 Preview2 ·¢²¼»ã×Ü - Savorboard

      .NET Core 2.0 Preview2 ·¢²¼»ã×Ü - Savorboard

      2017-07-01 11:01

    • ¡¾ASP.NET MVC Å£µ¶Ð¡ÊÔ¡¿ ASP.NET MVC ·ÓÉ - Alan_beijing

      ¡¾ASP.NET MVC Å£µ¶Ð¡ÊÔ¡¿ ASP.NET MVC ·ÓÉ - Alan_beijing

      2017-06-29 11:01

    ÍøÓѵãÆÀ
    Ö