@ecoding/base.build 0.0.22 → 0.0.24

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/libs/dev/index.js CHANGED
@@ -17,6 +17,7 @@ const getDevServer = () => {
17
17
  const dev = Object.assign({}, customConfig.dev);
18
18
  delete dev.publicPath;
19
19
  const obj = {
20
+ compress: true,
20
21
  // 配合单页路由 BrowserRouter 使用找寻index
21
22
  historyApiFallback: {
22
23
  rewrites: customConfig.mpa ? entryRewrites() : [{ from: /\.*/, to: "/index.html" }]
@@ -1,5 +1,6 @@
1
1
  const webpack = require("webpack");
2
2
  const path = require("path");
3
+ const fs = require('fs');
3
4
  const globby = require("globby");
4
5
  const WebpackBar = require("webpackbar");
5
6
  const HtmlWebpackPlugin = require("html-webpack-plugin");
@@ -37,9 +38,12 @@ const getHtmlWebpack = () => {
37
38
  const entry = getMPAEntries();
38
39
  entry.pages.forEach((pageName) => {
39
40
  const filename = `${pageName}.html`;
41
+ const skeletonPath = rootPath(`./skeleton/${filename}`);
42
+ const skeleton = fs.existsSync(skeletonPath) ? fs.readFileSync(skeletonPath, "utf-8") : ""
40
43
  const obj = {
41
44
  template,
42
45
  filename,
46
+ skeleton,
43
47
  inject: "body",
44
48
  inlineSource: "wp-runtime-",
45
49
  chunksSortMode: "manual",
@@ -60,8 +64,11 @@ const getHtmlWebpack = () => {
60
64
  });
61
65
  } else {
62
66
  const filename = `index.html`;
67
+ const skeletonPath = rootPath(`./skeleton/index.html`);
68
+ const skeleton = fs.existsSync(skeletonPath) ? fs.readFileSync(skeletonPath, "utf-8") : ""
63
69
  const obj = {
64
70
  template,
71
+ skeleton,
65
72
  filename,
66
73
  inlineSource: "wp-runtime-",
67
74
  inject: "body"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecoding/base.build",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
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": "c58167b6a4f2cbbd0a21c9b290746fc12ac5b05f"
56
+ "gitHead": "b226c65b9b4d7da0a351472bb96fb3ae27591644"
57
57
  }