ssr-plugin-react 6.1.40 → 6.1.41

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,14 @@
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.41](https://github.com/zhangyuang/ssr/compare/v6.1.40...v6.1.41) (2022-01-05)
7
+
8
+ **Note:** Version bump only for package ssr-plugin-react
9
+
10
+
11
+
12
+
13
+
6
14
  ## [6.1.40](https://github.com/zhangyuang/ssr/compare/v6.1.39...v6.1.40) (2022-01-04)
7
15
 
8
16
  **Note:** Version bump only for package ssr-plugin-react
@@ -4,9 +4,9 @@ exports.getBaseConfig = void 0;
4
4
  const path_1 = require("path");
5
5
  const ssr_server_utils_1 = require("ssr-server-utils");
6
6
  const webpack = require("webpack");
7
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
7
+ const MiniCssExtractPlugin = require((0, ssr_server_utils_1.loadModuleFromFramework)('mini-css-extract-plugin'));
8
8
  const WebpackBar = require('webpackbar');
9
- const loadModule = require.resolve;
9
+ const loadModule = ssr_server_utils_1.loadModuleFromFramework;
10
10
  const addBabelLoader = (chain, envOptions) => {
11
11
  chain.use('babel-loader')
12
12
  .loader(loadModule('babel-loader'))
@@ -9,7 +9,7 @@ const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
9
9
  const safePostCssParser = require('postcss-safe-parser');
10
10
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
11
11
  const generateAnalysis = Boolean(process.env.GENERATE_ANALYSIS);
12
- const loadModule = require.resolve;
12
+ const loadModule = ssr_server_utils_1.loadModuleFromFramework;
13
13
  let asyncChunkMap = {};
14
14
  const getClientWebpack = (chain) => {
15
15
  const { isDev, chunkName, getOutput, cwd, useHash, chainClientConfig } = (0, ssr_server_utils_1.loadConfig)();
@@ -18,7 +18,7 @@ const getClientWebpack = (chain) => {
18
18
  (0, base_1.getBaseConfig)(chain, false);
19
19
  chain.devtool(isDev ? 'cheap-module-source-map' : (shouldUseSourceMap ? 'source-map' : false));
20
20
  chain.entry(chunkName)
21
- .add(loadModule('../entry/client-entry'))
21
+ .add(require.resolve('../entry/client-entry'))
22
22
  .end()
23
23
  .output
24
24
  .path(getOutput().clientOutPut)
@@ -5,7 +5,6 @@ const path_1 = require("path");
5
5
  const ssr_server_utils_1 = require("ssr-server-utils");
6
6
  const webpack = require("webpack");
7
7
  const base_1 = require("./base");
8
- const loadModule = require.resolve;
9
8
  const getServerWebpack = (chain) => {
10
9
  const config = (0, ssr_server_utils_1.loadConfig)();
11
10
  const { isDev, cwd, getOutput, chainServerConfig, whiteList, chunkName } = config;
@@ -13,7 +12,7 @@ const getServerWebpack = (chain) => {
13
12
  chain.devtool(isDev ? 'inline-source-map' : false);
14
13
  chain.target('node');
15
14
  chain.entry(chunkName)
16
- .add(loadModule('../entry/server-entry'))
15
+ .add(require.resolve('../entry/server-entry'))
17
16
  .end()
18
17
  .output
19
18
  .path(getOutput().serverOutPut)
@@ -1,9 +1,9 @@
1
1
  import { join } from 'path';
2
- import { getCwd, loadConfig, getLocalNodeModules, setStyle, addImageChain } from 'ssr-server-utils';
2
+ import { getCwd, loadConfig, getLocalNodeModules, setStyle, addImageChain, loadModuleFromFramework } from 'ssr-server-utils';
3
3
  import * as webpack from 'webpack';
4
- const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4
+ const MiniCssExtractPlugin = require(loadModuleFromFramework('mini-css-extract-plugin'));
5
5
  const WebpackBar = require('webpackbar');
6
- const loadModule = require.resolve;
6
+ const loadModule = loadModuleFromFramework;
7
7
  const addBabelLoader = (chain, envOptions) => {
8
8
  chain.use('babel-loader')
9
9
  .loader(loadModule('babel-loader'))
@@ -1,12 +1,12 @@
1
1
  import { promises } from 'fs';
2
2
  import { resolve } from 'path';
3
- import { loadConfig, getCwd, cryptoAsyncChunkName, getOutputPublicPath } from 'ssr-server-utils';
3
+ import { loadConfig, getCwd, cryptoAsyncChunkName, getOutputPublicPath, loadModuleFromFramework } from 'ssr-server-utils';
4
4
  import { getBaseConfig } from './base';
5
5
  const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
6
6
  const safePostCssParser = require('postcss-safe-parser');
7
7
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
8
8
  const generateAnalysis = Boolean(process.env.GENERATE_ANALYSIS);
9
- const loadModule = require.resolve;
9
+ const loadModule = loadModuleFromFramework;
10
10
  let asyncChunkMap = {};
11
11
  const getClientWebpack = (chain) => {
12
12
  const { isDev, chunkName, getOutput, cwd, useHash, chainClientConfig } = loadConfig();
@@ -15,7 +15,7 @@ const getClientWebpack = (chain) => {
15
15
  getBaseConfig(chain, false);
16
16
  chain.devtool(isDev ? 'cheap-module-source-map' : (shouldUseSourceMap ? 'source-map' : false));
17
17
  chain.entry(chunkName)
18
- .add(loadModule('../entry/client-entry'))
18
+ .add(require.resolve('../entry/client-entry'))
19
19
  .end()
20
20
  .output
21
21
  .path(getOutput().clientOutPut)
@@ -2,7 +2,6 @@ import { join } from 'path';
2
2
  import { loadConfig, getLocalNodeModules, nodeExternals } from 'ssr-server-utils';
3
3
  import * as webpack from 'webpack';
4
4
  import { getBaseConfig } from './base';
5
- const loadModule = require.resolve;
6
5
  const getServerWebpack = (chain) => {
7
6
  const config = loadConfig();
8
7
  const { isDev, cwd, getOutput, chainServerConfig, whiteList, chunkName } = config;
@@ -10,7 +9,7 @@ const getServerWebpack = (chain) => {
10
9
  chain.devtool(isDev ? 'inline-source-map' : false);
11
10
  chain.target('node');
12
11
  chain.entry(chunkName)
13
- .add(loadModule('../entry/server-entry'))
12
+ .add(require.resolve('../entry/server-entry'))
14
13
  .end()
15
14
  .output
16
15
  .path(getOutput().serverOutPut)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssr-plugin-react",
3
- "version": "6.1.40",
3
+ "version": "6.1.41",
4
4
  "description": "plugin-react for ssr",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -58,8 +58,8 @@
58
58
  "serialize-javascript": "^6.0.0",
59
59
  "ssr-client-utils": "^6.1.38",
60
60
  "ssr-hoc-react": "^6.1.38",
61
- "ssr-server-utils": "^6.1.40",
62
- "ssr-webpack": "^6.1.40",
61
+ "ssr-server-utils": "^6.1.41",
62
+ "ssr-webpack": "^6.1.41",
63
63
  "terser-webpack-plugin": "^2.3.5",
64
64
  "url-loader": "^4.1.1",
65
65
  "vite": "^2.7.0",
@@ -76,5 +76,5 @@
76
76
  "@types/webpack": "^4.41.10",
77
77
  "ssr-types-react": "^6.1.38"
78
78
  },
79
- "gitHead": "a00bbe58da141c46b0efbf56d8093a2a68cd8028"
79
+ "gitHead": "281da0c4727326b724bf85bf174701734fee83ce"
80
80
  }
@@ -1,13 +1,13 @@
1
1
 
2
2
  import { join } from 'path'
3
3
  import { Mode } from 'ssr-types'
4
- import { getCwd, loadConfig, getLocalNodeModules, setStyle, addImageChain } from 'ssr-server-utils'
4
+ import { getCwd, loadConfig, getLocalNodeModules, setStyle, addImageChain, loadModuleFromFramework } from 'ssr-server-utils'
5
5
  import * as WebpackChain from 'webpack-chain'
6
6
  import * as webpack from 'webpack'
7
7
 
8
- const MiniCssExtractPlugin = require('mini-css-extract-plugin')
8
+ const MiniCssExtractPlugin = require(loadModuleFromFramework('mini-css-extract-plugin'))
9
9
  const WebpackBar = require('webpackbar')
10
- const loadModule = require.resolve
10
+ const loadModule = loadModuleFromFramework
11
11
 
12
12
  const addBabelLoader = (chain: WebpackChain.Rule<WebpackChain.Module>, envOptions: any) => {
13
13
  chain.use('babel-loader')
@@ -1,6 +1,6 @@
1
1
  import { promises } from 'fs'
2
2
  import { resolve } from 'path'
3
- import { loadConfig, getCwd, cryptoAsyncChunkName, getOutputPublicPath } from 'ssr-server-utils'
3
+ import { loadConfig, getCwd, cryptoAsyncChunkName, getOutputPublicPath, loadModuleFromFramework } from 'ssr-server-utils'
4
4
  import * as WebpackChain from 'webpack-chain'
5
5
  import { getBaseConfig } from './base'
6
6
 
@@ -8,7 +8,7 @@ const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin')
8
8
  const safePostCssParser = require('postcss-safe-parser')
9
9
  const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
10
10
  const generateAnalysis = Boolean(process.env.GENERATE_ANALYSIS)
11
- const loadModule = require.resolve
11
+ const loadModule = loadModuleFromFramework
12
12
  let asyncChunkMap: Record<string, string> = {}
13
13
 
14
14
  const getClientWebpack = (chain: WebpackChain) => {
@@ -18,7 +18,7 @@ const getClientWebpack = (chain: WebpackChain) => {
18
18
  getBaseConfig(chain, false)
19
19
  chain.devtool(isDev ? 'cheap-module-source-map' : (shouldUseSourceMap ? 'source-map' : false))
20
20
  chain.entry(chunkName)
21
- .add(loadModule('../entry/client-entry'))
21
+ .add(require.resolve('../entry/client-entry'))
22
22
  .end()
23
23
  .output
24
24
  .path(getOutput().clientOutPut)
@@ -4,8 +4,6 @@ import * as WebpackChain from 'webpack-chain'
4
4
  import * as webpack from 'webpack'
5
5
  import { getBaseConfig } from './base'
6
6
 
7
- const loadModule = require.resolve
8
-
9
7
  const getServerWebpack = (chain: WebpackChain) => {
10
8
  const config = loadConfig()
11
9
  const { isDev, cwd, getOutput, chainServerConfig, whiteList, chunkName } = config
@@ -13,7 +11,7 @@ const getServerWebpack = (chain: WebpackChain) => {
13
11
  chain.devtool(isDev ? 'inline-source-map' : false)
14
12
  chain.target('node')
15
13
  chain.entry(chunkName)
16
- .add(loadModule('../entry/server-entry'))
14
+ .add(require.resolve('../entry/server-entry'))
17
15
  .end()
18
16
  .output
19
17
  .path(getOutput().serverOutPut)