react-cosmos-plugin-vite 6.0.0-alpha.11 → 6.0.0-alpha.13

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.
@@ -10,6 +10,9 @@ async function mount() {
10
10
  mountDomRenderer(args);
11
11
  }
12
12
 
13
+ // Fallback for when React Refresh isn't enabled.
14
+ // Under normal conditions accepting HMR updates here isn't necessary because
15
+ // individual React modules will be hot reloaded by React Refresh.
13
16
  if (import.meta.hot) {
14
17
  import.meta.hot.accept(() => {
15
18
  mount();
@@ -1,3 +1,4 @@
1
+ import viteReactPlugin from '@vitejs/plugin-react';
1
2
  import { startFixtureWatcher } from 'react-cosmos';
2
3
  import { createServer } from 'vite';
3
4
  import { reactCosmosViteRollupPlugin, userDepsResolvedModuleId, } from './reactCosmosViteRollupPlugin.js';
@@ -16,7 +17,7 @@ export async function viteDevServerPlugin({ platformType, cosmosConfig, }) {
16
17
  host: '0.0.0.0',
17
18
  port: parseInt(new URL(rendererUrl).port, 10),
18
19
  },
19
- plugins: [reactCosmosViteRollupPlugin(cosmosConfig)],
20
+ plugins: [viteReactPlugin(), reactCosmosViteRollupPlugin(cosmosConfig)],
20
21
  });
21
22
  await server.listen();
22
23
  server.printUrls();
@@ -1,3 +1,4 @@
1
+ import viteReactPlugin from '@vitejs/plugin-react';
1
2
  import { rename } from 'node:fs/promises';
2
3
  import path from 'path';
3
4
  import { RENDERER_FILENAME } from 'react-cosmos';
@@ -15,7 +16,7 @@ export async function viteExportPlugin({ cosmosConfig }) {
15
16
  emptyOutDir: false,
16
17
  minify: false,
17
18
  },
18
- plugins: [reactCosmosViteRollupPlugin(cosmosConfig)],
19
+ plugins: [viteReactPlugin(), reactCosmosViteRollupPlugin(cosmosConfig)],
19
20
  });
20
21
  // Make way for the Playground's index.html
21
22
  await rename(path.resolve(exportPath, 'index.html'), path.resolve(exportPath, RENDERER_FILENAME));
package/package.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "name": "react-cosmos-plugin-vite",
3
- "version": "6.0.0-alpha.11",
3
+ "version": "6.0.0-alpha.13",
4
4
  "description": "Vite plugin for React Cosmos",
5
5
  "repository": "https://github.com/react-cosmos/react-cosmos/tree/main/packages/react-cosmos-plugin-vite",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "main": "cosmos.plugin.json",
9
9
  "dependencies": {
10
- "react-cosmos-core": "^6.0.0-alpha.11",
11
- "react-cosmos-dom": "^6.0.0-alpha.11"
10
+ "@vitejs/plugin-react": "^3.1.0",
11
+ "react-cosmos-core": "6.0.0-alpha.13",
12
+ "react-cosmos-dom": "6.0.0-alpha.13"
12
13
  },
13
14
  "peerDependencies": {
14
15
  "vite": "*"
15
16
  },
16
- "gitHead": "8e9d1e52749388f471f6ec848a8c904ec8b89f67"
17
+ "gitHead": "cf95e67ce942f6a242f023ecebe45d6916d5b753"
17
18
  }