@norejs/ssr-builder 0.0.1 → 0.0.2

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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@norejs/ssr-builder",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "SSR builder for NoreJS",
5
5
  "main": "index.js",
6
6
  "bin": {
7
- "norejs-ssr-builder": "./bin/norejs-ssr.js"
7
+ "norejs-ssr-builder": "./bin/norejs-ssr-builder.js"
8
8
  },
9
9
  "scripts": {
10
10
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -12,7 +12,7 @@
12
12
  "author": "",
13
13
  "license": "ISC",
14
14
  "dependencies": {
15
- "@norejs/ssr-server": "^0.0.1",
15
+ "@norejs/ssr-server": "^0.0.2",
16
16
  "commander": "10",
17
17
  "fs-extra": "^11.1.1",
18
18
  "webpack-merge": "^5.9.0",
@@ -6,6 +6,7 @@ const { requireNpmFromCwd } = require('../../../utils/project');
6
6
  // 去掉HTMLWebpackPlugin
7
7
  const ssrDisablePlugins = [
8
8
  'HtmlWebpackPlugin',
9
+ 'ReactRefreshPlugin',
9
10
  'InlineChunkHtmlPlugin',
10
11
  'HotModuleReplacementPlugin',
11
12
  'ManifestPlugin',
@@ -15,6 +16,7 @@ const ssrDisablePlugins = [
15
16
  const MiniCssExtractPlugin = requireNpmFromCwd('mini-css-extract-plugin');
16
17
 
17
18
  module.exports = function (baseConfig, ssrConfig, webpackEnv = 'development') {
19
+ console.log('baseConfig', baseConfig);
18
20
  // 去掉多余的插件
19
21
  baseConfig.plugins = baseConfig.plugins.filter((plugin) => {
20
22
  return !ssrDisablePlugins.includes(plugin.constructor.name);
@@ -58,7 +60,7 @@ module.exports = function (baseConfig, ssrConfig, webpackEnv = 'development') {
58
60
 
59
61
  // 读取env文件,或者自定义
60
62
  return merge(baseConfig, {
61
- entry: { main: '/' + ssrConfig.entry },
63
+ entry: { main: path.resolve(projectRoot, ssrConfig.entry) },
62
64
  output: {
63
65
  filename: 'server.js',
64
66
  path: path.resolve(projectRoot, ssrConfig.dist),
File without changes