ssr-plugin-react 6.1.30 → 6.1.31

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [6.1.31](https://github.com/zhangyuang/ssr/compare/v6.1.30...v6.1.31) (2021-12-17)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * node12 vite ssr optimize ([941a405](https://github.com/zhangyuang/ssr/commit/941a40507303606859ecd08a8594010929c4aaaa))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [6.1.30](https://github.com/zhangyuang/ssr/compare/v6.1.29...v6.1.30) (2021-12-17)
7
18
 
8
19
 
package/cjs/tools/vite.js CHANGED
@@ -6,7 +6,7 @@ const ssr_server_utils_1 = require("ssr-server-utils");
6
6
  const plugin_react_1 = require("@vitejs/plugin-react");
7
7
  const vite_plugin_style_import_1 = require("vite-plugin-style-import");
8
8
  const build = require('vite').build;
9
- const { getOutput, reactServerEntry, reactClientEntry, viteConfig, supportOptinalChaining } = (0, ssr_server_utils_1.loadConfig)();
9
+ const { getOutput, reactServerEntry, reactClientEntry, viteConfig, supportOptinalChaining, isDev } = (0, ssr_server_utils_1.loadConfig)();
10
10
  const { clientOutPut, serverOutPut } = getOutput();
11
11
  const styleImportConfig = {
12
12
  include: ['**/*.vue', '**/*.ts', '**/*.js', '**/*.tsx', '**/*.jsx', /chunkName/],
@@ -20,10 +20,6 @@ const styleImportConfig = {
20
20
  };
21
21
  const serverConfig = {
22
22
  ...(0, ssr_server_utils_1.commonConfig)(),
23
- optimizeDeps: {
24
- include: ['path-to-regexp', 'react-dom'],
25
- exclude: ['ssr-server-utils']
26
- },
27
23
  plugins: [
28
24
  (0, plugin_react_1.default)({
29
25
  ...(_b = (_a = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _a === void 0 ? void 0 : _a.server) === null || _b === void 0 ? void 0 : _b.defaultPluginOptions,
@@ -43,6 +39,7 @@ const serverConfig = {
43
39
  ssr: reactServerEntry,
44
40
  outDir: serverOutPut,
45
41
  rollupOptions: {
42
+ input: isDev ? reactClientEntry : '',
46
43
  output: {
47
44
  entryFileNames: 'Page.server.js'
48
45
  }
package/esm/tools/vite.js CHANGED
@@ -3,7 +3,7 @@ import { loadConfig, chunkNamePlugin, rollupOutputOptions, manifestPlugin, commo
3
3
  import react from '@vitejs/plugin-react';
4
4
  import styleImport, { AndDesignVueResolve, VantResolve, ElementPlusResolve, NutuiResolve, AntdResolve } from 'vite-plugin-style-import';
5
5
  const build = require('vite').build;
6
- const { getOutput, reactServerEntry, reactClientEntry, viteConfig, supportOptinalChaining } = loadConfig();
6
+ const { getOutput, reactServerEntry, reactClientEntry, viteConfig, supportOptinalChaining, isDev } = loadConfig();
7
7
  const { clientOutPut, serverOutPut } = getOutput();
8
8
  const styleImportConfig = {
9
9
  include: ['**/*.vue', '**/*.ts', '**/*.js', '**/*.tsx', '**/*.jsx', /chunkName/],
@@ -17,10 +17,6 @@ const styleImportConfig = {
17
17
  };
18
18
  const serverConfig = {
19
19
  ...commonConfig(),
20
- optimizeDeps: {
21
- include: ['path-to-regexp', 'react-dom'],
22
- exclude: ['ssr-server-utils']
23
- },
24
20
  plugins: [
25
21
  react({
26
22
  ...(_b = (_a = viteConfig === null || viteConfig === void 0 ? void 0 : viteConfig()) === null || _a === void 0 ? void 0 : _a.server) === null || _b === void 0 ? void 0 : _b.defaultPluginOptions,
@@ -40,6 +36,7 @@ const serverConfig = {
40
36
  ssr: reactServerEntry,
41
37
  outDir: serverOutPut,
42
38
  rollupOptions: {
39
+ input: isDev ? reactClientEntry : '',
43
40
  output: {
44
41
  entryFileNames: 'Page.server.js'
45
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssr-plugin-react",
3
- "version": "6.1.30",
3
+ "version": "6.1.31",
4
4
  "description": "plugin-react for ssr",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -76,5 +76,5 @@
76
76
  "@types/webpack": "^4.41.10",
77
77
  "ssr-types-react": "^6.1.29"
78
78
  },
79
- "gitHead": "880fd2d12752666a1d89dd37f30bf1fef801b0b2"
79
+ "gitHead": "e238c458fc4312003e20a33151f28aa70cfa1a1f"
80
80
  }
package/src/tools/vite.ts CHANGED
@@ -10,7 +10,7 @@ import styleImport, {
10
10
  } from 'vite-plugin-style-import'
11
11
 
12
12
  const build: typeof BuildType = require('vite').build
13
- const { getOutput, reactServerEntry, reactClientEntry, viteConfig, supportOptinalChaining } = loadConfig()
13
+ const { getOutput, reactServerEntry, reactClientEntry, viteConfig, supportOptinalChaining, isDev } = loadConfig()
14
14
 
15
15
  const { clientOutPut, serverOutPut } = getOutput()
16
16
  const styleImportConfig = {
@@ -25,10 +25,6 @@ const styleImportConfig = {
25
25
  }
26
26
  const serverConfig: UserConfig = {
27
27
  ...commonConfig(),
28
- optimizeDeps: {
29
- include: ['path-to-regexp', 'react-dom'],
30
- exclude: ['ssr-server-utils']
31
- },
32
28
  plugins: [
33
29
  react({
34
30
  ...viteConfig?.()?.server?.defaultPluginOptions,
@@ -48,6 +44,7 @@ const serverConfig: UserConfig = {
48
44
  ssr: reactServerEntry,
49
45
  outDir: serverOutPut,
50
46
  rollupOptions: {
47
+ input: isDev ? reactClientEntry : '',
51
48
  output: {
52
49
  entryFileNames: 'Page.server.js'
53
50
  }