@ecoding/base.build 0.0.15 → 0.0.17

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/README.md CHANGED
@@ -6,12 +6,13 @@
6
6
 
7
7
  ```javascript
8
8
  {
9
- mpa: boolean, // 是否是多页
10
- dll:boolean, // 是否打dll
11
- micro:"main" | "child", // 微前端主应用或子应用 默认null
12
- outputLibrary: string, // micro == child时生效,整个库向外暴露的变量名
13
- publicPath: string, // cdn 资源前缀
14
- outputPath: string, // build bundle 目录,相对命令执行目录
9
+ mpa: boolean; // 是否是多页
10
+ dll:boolean; // 是否打dll
11
+ micro:"main" | "child"; // 微前端主应用或子应用 默认null
12
+ outputLibrary: string; // micro == child时生效,整个库向外暴露的变量名
13
+ publicPath: string; // client cdn 资源前缀
14
+ outputPath: string; // client build bundle 目录,相对命令执行目录
15
+ runtimeChunk: bool; // 是否在html里内联webpack-runtime
15
16
  externals: object;
16
17
  /* externals
17
18
  {
@@ -27,6 +28,9 @@
27
28
  key: fs.readFileSync(path.join(__dirname, "./local.cxc.tech-key.pem")),
28
29
  cert: fs.readFileSync(path.join(__dirname, "./local.cxc.tech.pem"))
29
30
  }
31
+ },
32
+ ssr: {
33
+ outputPath: string; // ssr build bundle 目录,相对命令执行目录
30
34
  }
31
35
  }
32
36
  ```
@@ -62,7 +62,7 @@ const getOptimization = () => {
62
62
  };
63
63
  }
64
64
 
65
- if (customConfig.micro !== "child") {
65
+ if (customConfig.runtimeChunk && customConfig.micro !== "child") {
66
66
  obj.runtimeChunk = {
67
67
  // 单独分割运行时代码 webpack 运行时所需代码
68
68
  name: (entrypoint) => `wp-runtime-${entrypoint.name}`
@@ -62,7 +62,7 @@ const getOptimization = () => {
62
62
  };
63
63
  }
64
64
 
65
- if (customConfig.micro !== "child") {
65
+ if (customConfig.runtimeChunk && customConfig.micro !== "child") {
66
66
  obj.runtimeChunk = {
67
67
  // 单独分割运行时代码 webpack 运行时所需代码
68
68
  name: (entrypoint) => `wp-runtime-${entrypoint.name}`
@@ -14,7 +14,7 @@ const pubPath = () => {
14
14
  const getOutput = () => {
15
15
  return Object.assign({
16
16
  // 输出文件目录(将来所有资源输出的公共目录)
17
- path: rootPath(customConfig.outputPath || "../src/ssr"),
17
+ path: rootPath((customConfig.ssr && customConfig.ssr.outputPath) || "../src/ssr"),
18
18
 
19
19
  /**
20
20
  * 所有资源引入公共路径前缀 --> 'imgs/a.jpg' --> '/imgs/a.jpg'
@@ -96,7 +96,7 @@ module.exports = () => {
96
96
  ...getHtmlWebpack(),
97
97
 
98
98
  // 内联runtime
99
- customConfig.micro !== "child" && new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/wp-runtime-.*\.js/]),
99
+ customConfig.runtimeChunk && customConfig.micro !== "child" && new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/wp-runtime-.*\.js/]),
100
100
 
101
101
  new CleanWebpackPlugin(),
102
102
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecoding/base.build",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "tpl building",
5
5
  "author": "cxc",
6
6
  "license": "MIT",
@@ -53,5 +53,5 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "2106c9b443c0f004ba9c17ac744cc19be15998e5"
56
+ "gitHead": "4391d2d985b66c5d65433d0f5909d3ec0e725490"
57
57
  }