@standardagents/builder 0.9.8 → 0.9.9

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.
package/dist/index.js CHANGED
@@ -5848,71 +5848,46 @@ function agentbuilder(options = {}) {
5848
5848
  }
5849
5849
  return {
5850
5850
  name: "vite-plugin-agent",
5851
- config(config) {
5852
- const depsToInclude = [
5853
- "openai",
5854
- "zod",
5855
- "@standardagents/builder/runtime",
5856
- "@standardagents/builder/built-in-routes"
5857
- ];
5851
+ config() {
5858
5852
  const depsToExclude = [
5853
+ "@standardagents/builder",
5854
+ "@standardagents/builder/runtime",
5855
+ "@standardagents/builder/built-in-routes",
5859
5856
  "@standardagents/builder/mcp"
5860
5857
  ];
5861
- const environments = {};
5862
- if (config.environments) {
5863
- for (const envName of Object.keys(config.environments)) {
5864
- environments[envName] = {
5865
- optimizeDeps: {
5866
- include: depsToInclude,
5867
- exclude: depsToExclude
5868
- }
5869
- };
5870
- }
5871
- }
5872
5858
  return {
5873
- // Root optimizeDeps for client environment
5874
5859
  optimizeDeps: {
5875
- // Pre-bundle these deps upfront to prevent "new version of pre-bundle" errors
5876
- // during first startup when node_modules/.vite cache is empty.
5877
- // These are discovered dynamically by the virtual modules, so we need to
5878
- // tell Vite about them ahead of time.
5879
- include: depsToInclude,
5860
+ // Exclude our packages from pre-bundling - they contain cloudflare:workers imports
5861
+ // that cannot be resolved during dependency optimization
5880
5862
  exclude: depsToExclude
5881
5863
  },
5882
- // Also configure for environments (Cloudflare worker uses a custom environment)
5883
- environments,
5884
5864
  ssr: {
5885
- // Mark as external for SSR/worker builds to prevent bundling
5886
- // Note: @standardagents/builder, @standardagents/builder/runtime, built-in-routes, and rou3
5887
- // are NOT external - they must be bundled into the worker for Cloudflare Workers runtime
5888
- external: depsToExclude
5865
+ // Only MCP should be external (not used in worker)
5866
+ external: ["@standardagents/builder/mcp"],
5867
+ // noExternal ensures Vite transforms these instead of leaving as external
5868
+ // The Cloudflare plugin handles the actual bundling and knows about cloudflare:workers
5869
+ noExternal: [
5870
+ "@standardagents/builder",
5871
+ "@standardagents/builder/runtime",
5872
+ "@standardagents/builder/built-in-routes"
5873
+ ]
5889
5874
  },
5890
5875
  build: {
5891
5876
  rollupOptions: {
5892
- // Also mark as external for Rollup/build (used by Cloudflare Workers plugin)
5893
- // Note: @standardagents/builder, @standardagents/builder/runtime, built-in-routes, and rou3
5894
- // are NOT external - they must be bundled into the worker for Cloudflare Workers runtime
5895
- external: depsToExclude
5877
+ external: ["@standardagents/builder/mcp"]
5896
5878
  }
5897
5879
  }
5898
5880
  };
5899
5881
  },
5900
- // Use configEnvironment hook to set optimizeDeps for each environment including worker
5882
+ // Apply exclusions to ALL environments including Cloudflare worker
5901
5883
  configEnvironment(name, config) {
5902
- const depsToInclude = [
5903
- "openai",
5904
- "zod",
5905
- "@standardagents/builder/runtime",
5906
- "@standardagents/builder/built-in-routes"
5907
- ];
5908
5884
  const depsToExclude = [
5885
+ "@standardagents/builder",
5886
+ "@standardagents/builder/runtime",
5887
+ "@standardagents/builder/built-in-routes",
5909
5888
  "@standardagents/builder/mcp"
5910
5889
  ];
5911
5890
  config.optimizeDeps = config.optimizeDeps || {};
5912
- config.optimizeDeps.include = [
5913
- ...config.optimizeDeps.include || [],
5914
- ...depsToInclude.filter((dep) => !config.optimizeDeps?.include?.includes(dep))
5915
- ];
5916
5891
  config.optimizeDeps.exclude = [
5917
5892
  ...config.optimizeDeps.exclude || [],
5918
5893
  ...depsToExclude.filter((dep) => !config.optimizeDeps?.exclude?.includes(dep))