Can Razor Class Library pack static files (js, css etc) too?

后端 未结 7 1807
陌清茗
陌清茗 2020-11-30 01:50

Maybe duplicate of this already, but since that post does not have any answer, I am posting this question.

The new Razor Class Library is awesome, but it cannot pack

7条回答
  •  日久生厌
    2020-11-30 02:39

    In .NET Core 3.1, RCL includes assets inside wwwroot folder to consuming app under _content/{LIBRARY NAME}.

    We can change _content/{LIBRARY NAME} path to different path name by editing RCL project propeties and placing StaticWebAssetBasePath.

    PropertyGroup>
        /path
      
    

    Now you can access files with /path/test.js.

提交回复
热议问题