Skip to content

dotnet pack embeds dev-mode frontend bundles — sm pack must force a production Vite build #260

Open

Description

@antosubash

Found during module-packaging Session 1 checkpoint.

Packing SimpleModule.FeatureFlags after a dev workspace build put a ~1.3 MB unminified Manage-*.mjs chunk (plus 2.8 MB source map) into the nupkg's staticwebassets. The JsBuild target reuses whatever the last Vite build produced.

sm pack (Session 2) should force a production build (minified, no source maps — or maps stripped from the package) and fail closed if the bundle does not externalize react / react-dom / @inertiajs/react / SimpleModule.UI.

Activity

  1. webbrain-one commented on Aug 10, 2026

    @webbrain-one

    Thanks for catching this! I've opened a PR to address it: #291

    This update modifies sm pack to explicitly trigger a production Vite build before packaging. It ensures the bundled assets are minified, strips source maps from the final nupkg, and adds a build-time validation that fails if required dependencies (react, react-dom, @inertiajs/react, and SimpleModule.UI) aren't properly externalized.

    Let me know if you have any questions or feedback during review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    packagingModule packaging & distribution

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions