Pack web contents into embedded resources, compatible with vite, webpack, rollup or any other, even vanilla js
License
—
Deps
0
Install Size
—
Vulns
✓ 0
Published
Mar 7, 2023
$ dotnet add package WebContent.PackerPack web contents into embedded resources, compatible with vite, webpack, rollup or any other, even vanilla js
Usage
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<LangVersion>11.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="WebContent.Packer" Version="1.0.0" />
</ItemGroup>
</Project>
That's it, default webcontent folder is ./Views, ./View/dist/index.js and ./View/dist/style.css will compile as EmbeddedResource within dll.
You can change default folder via ViewPackageRoot, like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<LangVersion>11.0</LangVersion>
<ViewPackageRoot>where/ever/you/are</ViewPackageRoot>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="WebContent.Packer" Version="1.0.0" />
</ItemGroup>
</Project>
also there is option to change default npm client which is pnpm, like this <DefaultNpmClient>yarn</DefaultNpmClient>