@greatstore/cli 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +10 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -743,10 +743,18 @@ function viteConfig() {
743
743
  return `import { defineConfig } from "vite";
744
744
  import react from "@vitejs/plugin-react";
745
745
 
746
- // Builds a single ESM bundle suitable for \`gs push\`. React + ReactDOM
747
- // are externalized \u2014 the GreatStore runtime provides them at load time.
746
+ // Builds a single self-contained ESM bundle suitable for \`gs push\`.
747
+ // React + ReactDOM are bundled in so the file is portable across
748
+ // origins; the storefront mounts each component inside a shadow root
749
+ // so a duplicate React instance is harmless in practice.
750
+ // \`process.env.NODE_ENV\` is substituted at build time \u2014 react-dom
751
+ // reads it to pick prod vs. dev mode, and lib builds don't do this
752
+ // replacement on their own.
748
753
  export default defineConfig({
749
754
  plugins: [react()],
755
+ define: {
756
+ "process.env.NODE_ENV": JSON.stringify("production"),
757
+ },
750
758
  build: {
751
759
  lib: {
752
760
  entry: "component.tsx",
@@ -756,7 +764,6 @@ export default defineConfig({
756
764
  outDir: ".",
757
765
  emptyOutDir: false,
758
766
  rollupOptions: {
759
- external: ["react", "react-dom", "react/jsx-runtime"],
760
767
  output: { entryFileNames: "bundle.js" },
761
768
  },
762
769
  minify: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greatstore/cli",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "CLI for authoring and shipping GreatStore custom components.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",