Browse Source

数字孪生项目提交

master
pengpeng.zhai 2 years ago
commit
4994c0325d
100 changed files with 663 additions and 0 deletions
  1. 3
    0
      .babelrc
  2. 40
    0
      .eslintrc.json
  3. 105
    0
      .gitignore
  4. 12
    0
      .idea/chartDp.iml
  5. 5
    0
      .idea/codeStyles/Project.xml
  6. 5
    0
      .idea/codeStyles/codeStyleConfig.xml
  7. 4
    0
      .idea/encodings.xml
  8. 6
    0
      .idea/inspectionProfiles/Project_Default.xml
  9. 6
    0
      .idea/misc.xml
  10. 8
    0
      .idea/modules.xml
  11. 6
    0
      .idea/vcs.xml
  12. 37
    0
      .project
  13. 325
    0
      config/config.js
  14. 28
    0
      config/pathVars.js
  15. 11
    0
      config/webpack.dev.config.js
  16. 11
    0
      config/webpack.dist.config.js
  17. 51
    0
      config/webpack.dll.config.js
  18. BIN
      dev/static/center/maptile/4/1/0.jpg
  19. BIN
      dev/static/center/maptile/4/1/1.jpg
  20. BIN
      dev/static/center/maptile/4/2/0.jpg
  21. BIN
      dev/static/center/maptile/4/2/1.jpg
  22. BIN
      dev/static/center/maptile/4/3/0.jpg
  23. BIN
      dev/static/center/maptile/4/3/1.jpg
  24. BIN
      dev/static/center/maptile/5/1/1.jpg
  25. BIN
      dev/static/center/maptile/5/1/2.jpg
  26. BIN
      dev/static/center/maptile/5/3/1.jpg
  27. BIN
      dev/static/center/maptile/5/3/2.jpg
  28. BIN
      dev/static/center/maptile/5/3/3.jpg
  29. BIN
      dev/static/center/maptile/5/4/1.jpg
  30. BIN
      dev/static/center/maptile/5/4/2.jpg
  31. BIN
      dev/static/center/maptile/5/4/3.jpg
  32. BIN
      dev/static/center/maptile/5/5/1.jpg
  33. BIN
      dev/static/center/maptile/5/5/2.jpg
  34. BIN
      dev/static/center/maptile/5/5/3.jpg
  35. BIN
      dev/static/center/maptile/5/6/1.jpg
  36. BIN
      dev/static/center/maptile/5/6/2.jpg
  37. BIN
      dev/static/center/maptile/5/6/3.jpg
  38. BIN
      dev/static/center/maptile/5/7/1.jpg
  39. BIN
      dev/static/center/maptile/5/7/2.jpg
  40. BIN
      dev/static/center/maptile/5/7/3.jpg
  41. BIN
      dev/static/center/maptile/6/10/2.jpg
  42. BIN
      dev/static/center/maptile/6/10/3.jpg
  43. BIN
      dev/static/center/maptile/6/10/4.jpg
  44. BIN
      dev/static/center/maptile/6/10/5.jpg
  45. BIN
      dev/static/center/maptile/6/10/6.jpg
  46. BIN
      dev/static/center/maptile/6/11/2.jpg
  47. BIN
      dev/static/center/maptile/6/11/3.jpg
  48. BIN
      dev/static/center/maptile/6/11/4.jpg
  49. BIN
      dev/static/center/maptile/6/11/5.jpg
  50. BIN
      dev/static/center/maptile/6/11/6.jpg
  51. BIN
      dev/static/center/maptile/6/12/2.jpg
  52. BIN
      dev/static/center/maptile/6/12/3.jpg
  53. BIN
      dev/static/center/maptile/6/12/4.jpg
  54. BIN
      dev/static/center/maptile/6/12/5.jpg
  55. BIN
      dev/static/center/maptile/6/12/6.jpg
  56. BIN
      dev/static/center/maptile/6/13/2.jpg
  57. BIN
      dev/static/center/maptile/6/13/3.jpg
  58. BIN
      dev/static/center/maptile/6/13/4.jpg
  59. BIN
      dev/static/center/maptile/6/13/5.jpg
  60. BIN
      dev/static/center/maptile/6/13/6.jpg
  61. BIN
      dev/static/center/maptile/6/14/2.jpg
  62. BIN
      dev/static/center/maptile/6/14/3.jpg
  63. BIN
      dev/static/center/maptile/6/14/4.jpg
  64. BIN
      dev/static/center/maptile/6/14/5.jpg
  65. BIN
      dev/static/center/maptile/6/14/6.jpg
  66. BIN
      dev/static/center/maptile/6/7/2.jpg
  67. BIN
      dev/static/center/maptile/6/7/3.jpg
  68. BIN
      dev/static/center/maptile/6/7/4.jpg
  69. BIN
      dev/static/center/maptile/6/7/5.jpg
  70. BIN
      dev/static/center/maptile/6/7/6.jpg
  71. BIN
      dev/static/center/maptile/6/8/2.jpg
  72. BIN
      dev/static/center/maptile/6/8/3.jpg
  73. BIN
      dev/static/center/maptile/6/8/4.jpg
  74. BIN
      dev/static/center/maptile/6/8/5.jpg
  75. BIN
      dev/static/center/maptile/6/8/6.jpg
  76. BIN
      dev/static/center/maptile/6/9/2.jpg
  77. BIN
      dev/static/center/maptile/6/9/3.jpg
  78. BIN
      dev/static/center/maptile/6/9/4.jpg
  79. BIN
      dev/static/center/maptile/6/9/5.jpg
  80. BIN
      dev/static/center/maptile/6/9/6.jpg
  81. BIN
      dev/static/center/maptile/7/15/10.jpg
  82. BIN
      dev/static/center/maptile/7/15/11.jpg
  83. BIN
      dev/static/center/maptile/7/15/12.jpg
  84. BIN
      dev/static/center/maptile/7/15/13.jpg
  85. BIN
      dev/static/center/maptile/7/15/4.jpg
  86. BIN
      dev/static/center/maptile/7/15/5.jpg
  87. BIN
      dev/static/center/maptile/7/15/6.jpg
  88. BIN
      dev/static/center/maptile/7/15/7.jpg
  89. BIN
      dev/static/center/maptile/7/15/8.jpg
  90. BIN
      dev/static/center/maptile/7/15/9.jpg
  91. BIN
      dev/static/center/maptile/7/16/10.jpg
  92. BIN
      dev/static/center/maptile/7/16/11.jpg
  93. BIN
      dev/static/center/maptile/7/16/12.jpg
  94. BIN
      dev/static/center/maptile/7/16/13.jpg
  95. BIN
      dev/static/center/maptile/7/16/4.jpg
  96. BIN
      dev/static/center/maptile/7/16/5.jpg
  97. BIN
      dev/static/center/maptile/7/16/6.jpg
  98. BIN
      dev/static/center/maptile/7/16/7.jpg
  99. BIN
      dev/static/center/maptile/7/16/8.jpg
  100. 0
    0
      dev/static/center/maptile/7/16/9.jpg

+ 3
- 0
.babelrc View File

@@ -0,0 +1,3 @@
1
+{
2
+  "presets": ["env","stage-0"]
3
+}

+ 40
- 0
.eslintrc.json View File

@@ -0,0 +1,40 @@
1
+/*json 中也让写一下注释吧!!!*/
2
+{
3
+  "env": {
4
+    "browser": true,
5
+    "commonjs": true,
6
+    "es6": true
7
+  },
8
+  "extends": "eslint:recommended",
9
+  "parserOptions": {
10
+    "ecmaVersion": 2015,
11
+    "sourceType": "module"
12
+  },
13
+  "rules": {
14
+    "linebreak-style": 0,
15
+
16
+    //允许使用console
17
+    "no-console":2,
18
+
19
+    //单个文件不能超过500行
20
+    "max-lines": [1, 500],
21
+
22
+    //强制在代码块中使用一致的大括号风格
23
+    "brace-style": 2,
24
+
25
+    //禁止在不需要分行的时候使用了分行
26
+    "no-unexpected-multiline": 2,
27
+
28
+    //不要把空格和tab混用
29
+    "no-mixed-spaces-and-tabs": 2,
30
+
31
+    //函数参数禁止重名
32
+    "no-dupe-args": 2,
33
+
34
+    //class中的成员禁止重名
35
+    "no-dupe-class-members": 2,
36
+
37
+    //在对象字面量中,禁止使用重复的key
38
+    "no-dupe-keys": 2
39
+  }
40
+}

+ 105
- 0
.gitignore View File

@@ -0,0 +1,105 @@
1
+### macOS template
2
+# General
3
+.DS_Store
4
+.AppleDouble
5
+.LSOverride
6
+
7
+# Icon must end with two \r
8
+Icon
9
+
10
+# Thumbnails
11
+._*
12
+
13
+# Files that might appear in the root of a volume
14
+.DocumentRevisions-V100
15
+.fseventsd
16
+.Spotlight-V100
17
+.TemporaryItems
18
+.Trashes
19
+.VolumeIcon.icns
20
+.com.apple.timemachine.donotpresent
21
+
22
+# Directories potentially created on remote AFP share
23
+.AppleDB
24
+.AppleDesktop
25
+Network Trash Folder
26
+Temporary Items
27
+.apdisk
28
+### Windows template
29
+# Windows thumbnail cache files
30
+Thumbs.db
31
+ehthumbs.db
32
+ehthumbs_vista.db
33
+
34
+# Dump file
35
+*.stackdump
36
+
37
+# Folder config file
38
+Desktop.ini
39
+
40
+# Recycle Bin used on file shares
41
+$RECYCLE.BIN/
42
+
43
+# Windows Installer files
44
+*.cab
45
+*.msi
46
+*.msm
47
+*.msp
48
+
49
+# Windows shortcuts
50
+*.lnk
51
+
52
+### JetBrains template
53
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
54
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
55
+
56
+# User-specific stuff:
57
+.idea/**/workspace.xml
58
+.idea/**/tasks.xml
59
+.idea/dictionaries
60
+
61
+# Sensitive or high-churn files:
62
+.idea/**/dataSources/
63
+.idea/**/dataSources.ids
64
+.idea/**/dataSources.xml
65
+.idea/**/dataSources.local.xml
66
+.idea/**/sqlDataSources.xml
67
+.idea/**/dynamic.xml
68
+.idea/**/uiDesigner.xml
69
+
70
+# Gradle:
71
+.idea/**/gradle.xml
72
+.idea/**/libraries
73
+
74
+# CMake
75
+cmake-build-debug/
76
+
77
+# Mongo Explorer plugin:
78
+.idea/**/mongoSettings.xml
79
+
80
+## File-based project format:
81
+*.iws
82
+
83
+## Plugin-specific files:
84
+
85
+# IntelliJ
86
+out/
87
+
88
+# mpeltonen/sbt-idea plugin
89
+.idea_modules/
90
+
91
+# JIRA plugin
92
+atlassian-ide-plugin.xml
93
+
94
+# Cursive Clojure plugin
95
+.idea/replstate.xml
96
+
97
+# Crashlytics plugin (for Android Studio and IntelliJ)
98
+com_crashlytics_export_strings.xml
99
+crashlytics.properties
100
+crashlytics-build.properties
101
+fabric.properties
102
+
103
+/node_modules/
104
+/dist/
105
+/dll/

+ 12
- 0
.idea/chartDp.iml View File

@@ -0,0 +1,12 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<module type="WEB_MODULE" version="4">
3
+  <component name="NewModuleRootManager">
4
+    <content url="file://$MODULE_DIR$">
5
+      <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
+      <excludeFolder url="file://$MODULE_DIR$/temp" />
7
+      <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+    </content>
9
+    <orderEntry type="inheritedJdk" />
10
+    <orderEntry type="sourceFolder" forTests="false" />
11
+  </component>
12
+</module>

+ 5
- 0
.idea/codeStyles/Project.xml View File

@@ -0,0 +1,5 @@
1
+<component name="ProjectCodeStyleConfiguration">
2
+  <code_scheme name="Project" version="173">
3
+    <option name="LINE_SEPARATOR" value="&#10;" />
4
+  </code_scheme>
5
+</component>

+ 5
- 0
.idea/codeStyles/codeStyleConfig.xml View File

@@ -0,0 +1,5 @@
1
+<component name="ProjectCodeStyleConfiguration">
2
+  <state>
3
+    <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+  </state>
5
+</component>

+ 4
- 0
.idea/encodings.xml View File

@@ -0,0 +1,4 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="Encoding" addBOMForNewFiles="with NO BOM" />
4
+</project>

+ 6
- 0
.idea/inspectionProfiles/Project_Default.xml View File

@@ -0,0 +1,6 @@
1
+<component name="InspectionProjectProfileManager">
2
+  <profile version="1.0">
3
+    <option name="myName" value="Project Default" />
4
+    <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+  </profile>
6
+</component>

+ 6
- 0
.idea/misc.xml View File

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="JavaScriptSettings">
4
+    <option name="languageLevel" value="ES6" />
5
+  </component>
6
+</project>

+ 8
- 0
.idea/modules.xml View File

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="ProjectModuleManager">
4
+    <modules>
5
+      <module fileurl="file://$PROJECT_DIR$/.idea/chartDp.iml" filepath="$PROJECT_DIR$/.idea/chartDp.iml" />
6
+    </modules>
7
+  </component>
8
+</project>

+ 6
- 0
.idea/vcs.xml View File

@@ -0,0 +1,6 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project version="4">
3
+  <component name="VcsDirectoryMappings">
4
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
5
+  </component>
6
+</project>

+ 37
- 0
.project View File

@@ -0,0 +1,37 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<projectDescription>
3
+	<name>chartDp</name>
4
+	<comment></comment>
5
+	<projects>
6
+	</projects>
7
+	<buildSpec>
8
+		<buildCommand>
9
+			<name>com.aptana.ide.core.unifiedBuilder</name>
10
+			<arguments>
11
+			</arguments>
12
+		</buildCommand>
13
+	</buildSpec>
14
+	<natures>
15
+		<nature>com.aptana.projects.webnature</nature>
16
+	</natures>
17
+	<filteredResources>
18
+		<filter>
19
+			<id>1544687053343</id>
20
+			<name></name>
21
+			<type>26</type>
22
+			<matcher>
23
+				<id>org.eclipse.ui.ide.multiFilter</id>
24
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
25
+			</matcher>
26
+		</filter>
27
+		<filter>
28
+			<id>1599716527245</id>
29
+			<name></name>
30
+			<type>26</type>
31
+			<matcher>
32
+				<id>org.eclipse.ui.ide.multiFilter</id>
33
+				<arguments>1.0-name-matches-false-false-node_modules</arguments>
34
+			</matcher>
35
+		</filter>
36
+	</filteredResources>
37
+</projectDescription>

+ 325
- 0
config/config.js View File

@@ -0,0 +1,325 @@
1
+const path = require('path');
2
+const webpack = require('webpack');
3
+const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
4
+const glob = require("glob");
5
+const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
6
+const HtmlWebpackPlugin = require('html-webpack-plugin');
7
+// const CopyWebpackPlugin = require("copy-webpack-plugin");
8
+const CleanWebpackPlugin = require('clean-webpack-plugin');
9
+const packageJson = require("./../package.json");
10
+const HappyPack = require('happypack');
11
+const os = require('os');
12
+const happyThreadPool = HappyPack.ThreadPool({ size: os.cpus().length });
13
+let pathVars = require("./pathVars");
14
+let config = {};
15
+
16
+/*----------------------------------- page ---------------------------------*/
17
+//测试页面
18
+
19
+// let files = glob.sync(pathVars.testPath + `/pie/ChartPie?(9|21|32)/index.html`);
20
+let files = glob.sync(pathVars.testPath + `/factory/ChartPark/index.html`);
21
+// files = files.concat(glob.sync(pathVars.testPath + "/factory/ChartFactoryTest/index.html"));
22
+files = files.concat(glob.sync(pathVars.testPath + "/factory/ChartBar41/index.html"));
23
+files = files.concat(glob.sync(pathVars.testPath + "/factory/ChartFactory1/index.html"));
24
+files = files.concat(glob.sync(pathVars.testPath + "/factory/ChartFactory2/index.html"));
25
+// files = files.concat(glob.sync(pathVars.testPath + "/factory/threeScene/index.html"));
26
+
27
+console.log("测试页面\n", files);
28
+let entryDev = {
29
+  vendor: Object.keys(packageJson.dependencies)
30
+};
31
+let pageAry = [];
32
+files.forEach(function (filePath) {
33
+  //将单个文件路径(/test/ChartBar3D/index.htsml)路径拆分成数组
34
+  let tempAry = filePath.split('/');
35
+  //demo文件夹名
36
+  let typeName = tempAry[tempAry.length - 3];
37
+  let chunkName = tempAry[tempAry.length - 2];
38
+  let htmlName = chunkName + "/index.html";
39
+
40
+  let obj = {};
41
+  obj["filePath"] = filePath;
42
+  obj["chunkName"] = chunkName;
43
+  obj["htmlName"] = htmlName;
44
+  obj["entryJs"] = pathVars.testPath + "/" + typeName + "/" + chunkName + "/index.js";
45
+  entryDev[chunkName] = obj["entryJs"];
46
+  pageAry.push(obj);
47
+});
48
+
49
+
50
+//图表主js文件
51
+let chartFiles = glob.sync(pathVars.srcPath + "/chart/factory/ChartPark/ChartPark.js");
52
+console.log("图表主js文件\n", chartFiles);
53
+let chartAry = [];
54
+let entryDist = {};
55
+chartFiles.forEach(function (filePath) {
56
+  //将单个文件路径(/src/chart/ChartEarth/ChartEarth.js)路径拆分成数组
57
+  let tempAry = filePath.split('/');
58
+  let chunkName = tempAry[tempAry.length - 2];
59
+  let obj = {};
60
+  obj["chunkName"] = chunkName;
61
+  chartAry.push(obj);
62
+  //
63
+  entryDist[chunkName] = filePath;
64
+});
65
+
66
+
67
+/*-----------------------------  entry  ------------------------------*/
68
+
69
+config["entryDev"] = entryDev;
70
+
71
+
72
+config["entryDist"] = entryDist;
73
+
74
+
75
+/*-----------------------------  devServer  ------------------------------*/
76
+let devServer = {
77
+  // open: true,
78
+  publicPath: "/",
79
+  contentBase: pathVars.devPath,
80
+  hot: true,
81
+  inline: true,
82
+  port: 3006,
83
+  host: '192.168.1.103'
84
+  // host: 'localhost'
85
+};
86
+config["devServer"] = devServer;
87
+
88
+
89
+/*-----------------------------  output  ------------------------------*/
90
+let outputDev = {
91
+  path: pathVars.distPath,
92
+  publicPath: "/",     // 表示资源的发布地址,当配置过该属性后,打包文件中所有通过相对路径引用的资源都会被配置的路径所替换(如:css中背景图的路径)
93
+  filename: "[name]/main.js"
94
+};
95
+config["outputDev"] = outputDev;
96
+
97
+let outputDist = {
98
+  path: pathVars.distPath,
99
+  publicPath: "/",
100
+  filename: "[name]_[chunkhash:5].js",
101
+  library: "[name]",
102
+  libraryTarget: "umd"
103
+  //  libraryExport: "default"
104
+};
105
+config["outputDist"] = outputDist;
106
+
107
+
108
+/*-----------------------------  externals  ------------------------------*/
109
+if (process.env.NODE_ENV === "noThird") {
110
+  console.log("==================", process.env.NODE_ENV);
111
+  config["externals"] = {
112
+    'three': {
113
+      commonjs: 'THREE',
114
+      commonjs2: 'THREE',
115
+      amd: 'THREE',
116
+      root: 'THREE'
117
+    },
118
+    'zrender': {
119
+      commonjs: 'zrender',
120
+      commonjs2: 'zrender',
121
+      amd: 'zrender',
122
+      root: 'zrender'
123
+    },
124
+    'gsap': {
125
+      commonjs: 'gsap',
126
+      commonjs2: 'gsap',
127
+      amd: 'gsap',
128
+      root: 'gsap'
129
+    }
130
+  };
131
+} else {
132
+  config["externals"] = {};
133
+  config["outputDist"]["filename"] = "[name].js"
134
+}
135
+
136
+
137
+/*-----------------------------  module  ------------------------------*/
138
+let rules = [
139
+  // {
140
+  //     test: /\.js$/,
141
+  //     exclude: pathVars.nodeModulesPath,
142
+  //
143
+  //     //use: ['babel-loader'],
144
+  //     use: ["happypack/loader?id=babel"]
145
+  // },
146
+  {
147
+    test: /\.js$/,
148
+    // exclude: pathVars.nodeModulesPath,
149
+    loader: "babel-loader",
150
+  },
151
+  // {
152
+  //     test: /\.glsl$/,
153
+  //     loader: 'webpack-glsl-loader'
154
+  // },
155
+  {
156
+    test: /\.(glsl|vs|fs|vert|frag)$/,
157
+    // exclude: [pathVars.nodeModulesPath, pathVars.dllPath],
158
+    use: ["raw-loader", "glslify-loader"]
159
+  }
160
+]
161
+// let jsonRuleDist={
162
+//     test:/\.json$/,
163
+//     type: 'javascript/auto',
164
+//     use:[
165
+//         {
166
+//             loader: 'json-loader',
167
+//
168
+//             options: {
169
+//                 publicPath: '../../static/',
170
+//                 name: 'json/[name]_[hash:5].[ext]'
171
+//             }
172
+//         }
173
+//     ]
174
+// };
175
+let imgRuleDev = {
176
+  test: /\.(png|jpg|gif)$/,
177
+  // loader: 'url-loader?limit=1000&name=images/[name]_[hash:5].[ext]',
178
+  use: [
179
+    {
180
+      loader: 'file-loader',
181
+      options: {
182
+        publicPath: '/',
183
+        name: 'imgInChart/[name]_[hash:5].[ext]'
184
+      }
185
+    }
186
+  ]
187
+}
188
+let imgRuleDist = {
189
+  test: /\.(png|jpg|gif)$/,
190
+  // loader: 'url-loader?limit=1000&name=images/[name]_[hash:5].[ext]',
191
+  use: [
192
+    {
193
+      loader: 'file-loader',
194
+      options: {
195
+        publicPath: '../../static/',
196
+        name: 'imgInChart/[name]_[hash:5].[ext]'
197
+      }
198
+    }
199
+  ]
200
+};
201
+
202
+config["moduleBaseDev"] = { rules: rules.concat(imgRuleDev) };
203
+config["moduleBaseDist"] = { rules: rules.concat(imgRuleDist) };
204
+
205
+
206
+//---------------------------------- plugin -----------------------------------//
207
+let pluginBase = [
208
+  /*new CopyWebpackPlugin([{
209
+      from: pathVars.staticPath,
210
+      //to 起始位置为发布目录
211
+      to: "static"
212
+  }]),*/
213
+  new webpack.DllReferencePlugin({
214
+    context: pathVars.rootPath,
215
+    manifest: require(pathVars.dllPath + '/manifest.json')
216
+  }),
217
+  new HappyPack({
218
+    id: 'babel',
219
+    loaders: ["babel-loader"],
220
+    threadPool: happyThreadPool
221
+  }),
222
+  new webpack.DefinePlugin({
223
+    my_ENV: JSON.stringify(process.env.my_ENV)
224
+  })
225
+];
226
+
227
+const htmlBase = [];
228
+pageAry.forEach(function (page) {
229
+  const htmlPlugin = new HtmlWebpackPlugin({
230
+    title: '',
231
+    template: page["filePath"],
232
+    filename: page["htmlName"],
233
+    inject: 'body',
234
+    chunks: ["manifest", "vendor", "common", page["chunkName"]],
235
+    chunksSortMode: 'none'
236
+  });
237
+  htmlBase.push(htmlPlugin);
238
+});
239
+// pageVars.forEach(function (page) {
240
+//     let htmlPlugin = new HtmlWebpackPlugin({
241
+//         title: 'page1',
242
+//         template: page["filePath"],
243
+//         filename: page["htmlName"],
244
+//         inject: 'body',
245
+//         chunks: /*isDev ? [page["chunkName"]] :*/ ["manifest", "vendor", "common", page["chunkName"]],
246
+//         chunksSortMode: 'dependency'
247
+//     });
248
+//     pluginBase.push(htmlPlugin);
249
+// });
250
+
251
+//------------------- dev
252
+let pluginsDev = [
253
+  new webpack.HotModuleReplacementPlugin()
254
+];
255
+config["pluginsDev"] = pluginBase.concat(pluginsDev, htmlBase);
256
+
257
+
258
+//------------------- dist
259
+let pluginDist = [
260
+  new CleanWebpackPlugin(pathVars.distPath,
261
+    {
262
+      root: pathVars.rootPath,
263
+      verbose: true
264
+    }
265
+  ),
266
+  new webpack.NoEmitOnErrorsPlugin(),
267
+
268
+
269
+];
270
+config["pluginDist"] = pluginBase.concat(pluginDist);
271
+
272
+//----------------------------------- optimization  ---------------------------//
273
+config["optimizationDev"] = {
274
+  minimize: false,
275
+  splitChunks: {
276
+    chunks: "all", //initial
277
+    minSize: 30 * 1024, //模块大于30k会被抽离到公共模块 也就是说每个页面的js不会大于30k
278
+    minChunks: 1, //模块出现1次就会被抽离到公共模块
279
+    maxAsyncRequests: 5, //异步模块,一次最多只能被加载5个
280
+    maxInitialRequests: 3, //入口模块最多只能加载3个
281
+    name: true,
282
+    cacheGroups: {
283
+      default: {
284
+        chunks: "all",
285
+        name: "common",
286
+        test: /[\\/]src[\\/]/,
287
+        minChunks: 3,
288
+        priority: -20,
289
+        reuseExistingChunk: true
290
+      },
291
+      vendor: {
292
+        chunks: "all",
293
+        name: "vendor",
294
+        test: /[\\/]node_modules[\\/]/,
295
+        minChunks: 1,
296
+        priority: -10
297
+      }
298
+    }
299
+  },
300
+  runtimeChunk: {
301
+    name: "manifest"
302
+  }
303
+};
304
+//
305
+config["optimizationDist"] = {
306
+  minimize: true,
307
+  minimizer: [
308
+    new UglifyJsPlugin({
309
+      cache: true,
310
+      parallel: true,
311
+      uglifyOptions: {
312
+        warnings: false,
313
+        compress: {
314
+          // warnings: false,
315
+          drop_debugger: true,
316
+          drop_console: true
317
+        }
318
+      }
319
+    }),
320
+    new OptimizeCssAssetsPlugin({})
321
+  ],
322
+  splitChunks: {}
323
+
324
+};
325
+module.exports = config;

+ 28
- 0
config/pathVars.js View File

@@ -0,0 +1,28 @@
1
+const path = require('path');
2
+let pathVars = {};
3
+
4
+//项目根目录
5
+pathVars.rootPath = path.resolve(__dirname, '../');
6
+
7
+//源文件目录
8
+pathVars.srcPath = path.resolve(pathVars.rootPath, './src');
9
+
10
+//预编译文件存放目录
11
+pathVars.dllPath = path.resolve(pathVars.rootPath, './dll');
12
+
13
+//开发测试目录
14
+pathVars.devPath = path.resolve(pathVars.rootPath, './dev');
15
+
16
+//
17
+pathVars.staticPath = path.resolve(pathVars.rootPath, './dev/static');
18
+
19
+//发布目录
20
+pathVars.distPath = path.resolve(pathVars.rootPath, './dist');
21
+
22
+//node_modules目录
23
+pathVars.nodeModulesPath = path.resolve(pathVars.rootPath, './node_modules');
24
+
25
+//测试目录
26
+pathVars.testPath = path.resolve(pathVars.rootPath, './test');
27
+
28
+module.exports = pathVars;

+ 11
- 0
config/webpack.dev.config.js View File

@@ -0,0 +1,11 @@
1
+let config = require("./config");
2
+module.exports = {
3
+    mode: 'development',
4
+    devtool: 'eval-source-map',
5
+    entry: config.entryDev,
6
+    output: config.outputDev,
7
+    devServer:config.devServer,
8
+    plugins: config.pluginsDev,
9
+    module: config.moduleBaseDev,
10
+    optimization: config["optimizationDev"]
11
+};

+ 11
- 0
config/webpack.dist.config.js View File

@@ -0,0 +1,11 @@
1
+let config = require("./config");
2
+
3
+module.exports = {
4
+    mode:"production",
5
+    entry: config.entryDist,
6
+    output: config.outputDist,
7
+    externals: config.externals,
8
+    plugins: config.pluginDist,
9
+    module: config.moduleBaseDist,
10
+    optimization:config["optimizationDist"]
11
+};

+ 51
- 0
config/webpack.dll.config.js View File

@@ -0,0 +1,51 @@
1
+/*
2
+ * 用来预编译第三方库*/
3
+
4
+const webpack = require('webpack');
5
+const pathVars = require('./pathVars');
6
+const packageJson = require("./../package.json");
7
+// const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
8
+//
9
+module.exports = {
10
+    mode: 'development',
11
+    entry: {
12
+        /*第三方库*/
13
+        dll: Object.keys(packageJson.dependencies)
14
+    },
15
+    output: {
16
+        path: pathVars.dllPath,
17
+        filename: "[name].js",
18
+        library: '[name]',
19
+        libraryTarget: 'umd',
20
+        umdNamedDefine: true
21
+    },
22
+    plugins: [
23
+        //new webpack.NoEmitOnErrorsPlugin(),
24
+        new webpack.DllPlugin({
25
+            // path 定义 manifest 文件生成的位置 [name]的部分由entry的名字替换
26
+            path: pathVars.dllPath + '/manifest.json',
27
+            // name 是dll暴露的对象名,要跟 output.library 保持一致
28
+            name: '[name]',
29
+            // context 是解析包路径的上下文,这个要跟接下来配置的dll一致
30
+            context: pathVars.dllPath
31
+        })
32
+    ],
33
+    module: {
34
+        rules: [
35
+            {
36
+                test: /\.(css|less)$/,
37
+                //exclude: [pathVars.nodeModulesPath],
38
+                use: [
39
+                    "style-loader",
40
+                    "css-loader",
41
+                    "less-loader"
42
+                ],
43
+            },
44
+            {
45
+                test: /\.js$/,
46
+                //exclude: pathVars.nodeModulesPath,
47
+                loader: "babel-loader"
48
+            }
49
+        ]
50
+    }
51
+};

BIN
dev/static/center/maptile/4/1/0.jpg View File


BIN
dev/static/center/maptile/4/1/1.jpg View File


BIN
dev/static/center/maptile/4/2/0.jpg View File


BIN
dev/static/center/maptile/4/2/1.jpg View File


BIN
dev/static/center/maptile/4/3/0.jpg View File


BIN
dev/static/center/maptile/4/3/1.jpg View File


BIN
dev/static/center/maptile/5/1/1.jpg View File


BIN
dev/static/center/maptile/5/1/2.jpg View File


BIN
dev/static/center/maptile/5/3/1.jpg View File


BIN
dev/static/center/maptile/5/3/2.jpg View File


BIN
dev/static/center/maptile/5/3/3.jpg View File


BIN
dev/static/center/maptile/5/4/1.jpg View File


BIN
dev/static/center/maptile/5/4/2.jpg View File


BIN
dev/static/center/maptile/5/4/3.jpg View File


BIN
dev/static/center/maptile/5/5/1.jpg View File


BIN
dev/static/center/maptile/5/5/2.jpg View File


BIN
dev/static/center/maptile/5/5/3.jpg View File


BIN
dev/static/center/maptile/5/6/1.jpg View File


BIN
dev/static/center/maptile/5/6/2.jpg View File


BIN
dev/static/center/maptile/5/6/3.jpg View File


BIN
dev/static/center/maptile/5/7/1.jpg View File


BIN
dev/static/center/maptile/5/7/2.jpg View File


BIN
dev/static/center/maptile/5/7/3.jpg View File


BIN
dev/static/center/maptile/6/10/2.jpg View File


BIN
dev/static/center/maptile/6/10/3.jpg View File


BIN
dev/static/center/maptile/6/10/4.jpg View File


BIN
dev/static/center/maptile/6/10/5.jpg View File


BIN
dev/static/center/maptile/6/10/6.jpg View File


BIN
dev/static/center/maptile/6/11/2.jpg View File


BIN
dev/static/center/maptile/6/11/3.jpg View File


BIN
dev/static/center/maptile/6/11/4.jpg View File


BIN
dev/static/center/maptile/6/11/5.jpg View File


BIN
dev/static/center/maptile/6/11/6.jpg View File


BIN
dev/static/center/maptile/6/12/2.jpg View File


BIN
dev/static/center/maptile/6/12/3.jpg View File


BIN
dev/static/center/maptile/6/12/4.jpg View File


BIN
dev/static/center/maptile/6/12/5.jpg View File


BIN
dev/static/center/maptile/6/12/6.jpg View File


BIN
dev/static/center/maptile/6/13/2.jpg View File


BIN
dev/static/center/maptile/6/13/3.jpg View File


BIN
dev/static/center/maptile/6/13/4.jpg View File


BIN
dev/static/center/maptile/6/13/5.jpg View File


BIN
dev/static/center/maptile/6/13/6.jpg View File


BIN
dev/static/center/maptile/6/14/2.jpg View File


BIN
dev/static/center/maptile/6/14/3.jpg View File


BIN
dev/static/center/maptile/6/14/4.jpg View File


BIN
dev/static/center/maptile/6/14/5.jpg View File


BIN
dev/static/center/maptile/6/14/6.jpg View File


BIN
dev/static/center/maptile/6/7/2.jpg View File


BIN
dev/static/center/maptile/6/7/3.jpg View File


BIN
dev/static/center/maptile/6/7/4.jpg View File


BIN
dev/static/center/maptile/6/7/5.jpg View File


BIN
dev/static/center/maptile/6/7/6.jpg View File


BIN
dev/static/center/maptile/6/8/2.jpg View File


BIN
dev/static/center/maptile/6/8/3.jpg View File


BIN
dev/static/center/maptile/6/8/4.jpg View File


BIN
dev/static/center/maptile/6/8/5.jpg View File


BIN
dev/static/center/maptile/6/8/6.jpg View File


BIN
dev/static/center/maptile/6/9/2.jpg View File


BIN
dev/static/center/maptile/6/9/3.jpg View File


BIN
dev/static/center/maptile/6/9/4.jpg View File


BIN
dev/static/center/maptile/6/9/5.jpg View File


BIN
dev/static/center/maptile/6/9/6.jpg View File


BIN
dev/static/center/maptile/7/15/10.jpg View File


BIN
dev/static/center/maptile/7/15/11.jpg View File


BIN
dev/static/center/maptile/7/15/12.jpg View File


BIN
dev/static/center/maptile/7/15/13.jpg View File


BIN
dev/static/center/maptile/7/15/4.jpg View File


BIN
dev/static/center/maptile/7/15/5.jpg View File


BIN
dev/static/center/maptile/7/15/6.jpg View File


BIN
dev/static/center/maptile/7/15/7.jpg View File


BIN
dev/static/center/maptile/7/15/8.jpg View File


BIN
dev/static/center/maptile/7/15/9.jpg View File


BIN
dev/static/center/maptile/7/16/10.jpg View File


BIN
dev/static/center/maptile/7/16/11.jpg View File


BIN
dev/static/center/maptile/7/16/12.jpg View File


BIN
dev/static/center/maptile/7/16/13.jpg View File


BIN
dev/static/center/maptile/7/16/4.jpg View File


BIN
dev/static/center/maptile/7/16/5.jpg View File


BIN
dev/static/center/maptile/7/16/6.jpg View File


BIN
dev/static/center/maptile/7/16/7.jpg View File


BIN
dev/static/center/maptile/7/16/8.jpg View File


+ 0
- 0
dev/static/center/maptile/7/16/9.jpg View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save