瀏覽代碼

代码提交

master
pengpeng.zhai 2 年之前
父節點
當前提交
cdb54e07e6
共有 100 個檔案被更改,包括 686 行新增0 行删除
  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. 348
    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. 二進制
      dev/static/center/maptile/4/1/0.jpg
  19. 二進制
      dev/static/center/maptile/4/1/1.jpg
  20. 二進制
      dev/static/center/maptile/4/2/0.jpg
  21. 二進制
      dev/static/center/maptile/4/2/1.jpg
  22. 二進制
      dev/static/center/maptile/4/3/0.jpg
  23. 二進制
      dev/static/center/maptile/4/3/1.jpg
  24. 二進制
      dev/static/center/maptile/5/1/1.jpg
  25. 二進制
      dev/static/center/maptile/5/1/2.jpg
  26. 二進制
      dev/static/center/maptile/5/3/1.jpg
  27. 二進制
      dev/static/center/maptile/5/3/2.jpg
  28. 二進制
      dev/static/center/maptile/5/3/3.jpg
  29. 二進制
      dev/static/center/maptile/5/4/1.jpg
  30. 二進制
      dev/static/center/maptile/5/4/2.jpg
  31. 二進制
      dev/static/center/maptile/5/4/3.jpg
  32. 二進制
      dev/static/center/maptile/5/5/1.jpg
  33. 二進制
      dev/static/center/maptile/5/5/2.jpg
  34. 二進制
      dev/static/center/maptile/5/5/3.jpg
  35. 二進制
      dev/static/center/maptile/5/6/1.jpg
  36. 二進制
      dev/static/center/maptile/5/6/2.jpg
  37. 二進制
      dev/static/center/maptile/5/6/3.jpg
  38. 二進制
      dev/static/center/maptile/5/7/1.jpg
  39. 二進制
      dev/static/center/maptile/5/7/2.jpg
  40. 二進制
      dev/static/center/maptile/5/7/3.jpg
  41. 二進制
      dev/static/center/maptile/6/10/2.jpg
  42. 二進制
      dev/static/center/maptile/6/10/3.jpg
  43. 二進制
      dev/static/center/maptile/6/10/4.jpg
  44. 二進制
      dev/static/center/maptile/6/10/5.jpg
  45. 二進制
      dev/static/center/maptile/6/10/6.jpg
  46. 二進制
      dev/static/center/maptile/6/11/2.jpg
  47. 二進制
      dev/static/center/maptile/6/11/3.jpg
  48. 二進制
      dev/static/center/maptile/6/11/4.jpg
  49. 二進制
      dev/static/center/maptile/6/11/5.jpg
  50. 二進制
      dev/static/center/maptile/6/11/6.jpg
  51. 二進制
      dev/static/center/maptile/6/12/2.jpg
  52. 二進制
      dev/static/center/maptile/6/12/3.jpg
  53. 二進制
      dev/static/center/maptile/6/12/4.jpg
  54. 二進制
      dev/static/center/maptile/6/12/5.jpg
  55. 二進制
      dev/static/center/maptile/6/12/6.jpg
  56. 二進制
      dev/static/center/maptile/6/13/2.jpg
  57. 二進制
      dev/static/center/maptile/6/13/3.jpg
  58. 二進制
      dev/static/center/maptile/6/13/4.jpg
  59. 二進制
      dev/static/center/maptile/6/13/5.jpg
  60. 二進制
      dev/static/center/maptile/6/13/6.jpg
  61. 二進制
      dev/static/center/maptile/6/14/2.jpg
  62. 二進制
      dev/static/center/maptile/6/14/3.jpg
  63. 二進制
      dev/static/center/maptile/6/14/4.jpg
  64. 二進制
      dev/static/center/maptile/6/14/5.jpg
  65. 二進制
      dev/static/center/maptile/6/14/6.jpg
  66. 二進制
      dev/static/center/maptile/6/7/2.jpg
  67. 二進制
      dev/static/center/maptile/6/7/3.jpg
  68. 二進制
      dev/static/center/maptile/6/7/4.jpg
  69. 二進制
      dev/static/center/maptile/6/7/5.jpg
  70. 二進制
      dev/static/center/maptile/6/7/6.jpg
  71. 二進制
      dev/static/center/maptile/6/8/2.jpg
  72. 二進制
      dev/static/center/maptile/6/8/3.jpg
  73. 二進制
      dev/static/center/maptile/6/8/4.jpg
  74. 二進制
      dev/static/center/maptile/6/8/5.jpg
  75. 二進制
      dev/static/center/maptile/6/8/6.jpg
  76. 二進制
      dev/static/center/maptile/6/9/2.jpg
  77. 二進制
      dev/static/center/maptile/6/9/3.jpg
  78. 二進制
      dev/static/center/maptile/6/9/4.jpg
  79. 二進制
      dev/static/center/maptile/6/9/5.jpg
  80. 二進制
      dev/static/center/maptile/6/9/6.jpg
  81. 二進制
      dev/static/center/maptile/7/15/10.jpg
  82. 二進制
      dev/static/center/maptile/7/15/11.jpg
  83. 二進制
      dev/static/center/maptile/7/15/12.jpg
  84. 二進制
      dev/static/center/maptile/7/15/13.jpg
  85. 二進制
      dev/static/center/maptile/7/15/4.jpg
  86. 二進制
      dev/static/center/maptile/7/15/5.jpg
  87. 二進制
      dev/static/center/maptile/7/15/6.jpg
  88. 二進制
      dev/static/center/maptile/7/15/7.jpg
  89. 二進制
      dev/static/center/maptile/7/15/8.jpg
  90. 二進制
      dev/static/center/maptile/7/15/9.jpg
  91. 二進制
      dev/static/center/maptile/7/16/10.jpg
  92. 二進制
      dev/static/center/maptile/7/16/11.jpg
  93. 二進制
      dev/static/center/maptile/7/16/12.jpg
  94. 二進制
      dev/static/center/maptile/7/16/13.jpg
  95. 二進制
      dev/static/center/maptile/7/16/4.jpg
  96. 二進制
      dev/static/center/maptile/7/16/5.jpg
  97. 二進制
      dev/static/center/maptile/7/16/6.jpg
  98. 二進制
      dev/static/center/maptile/7/16/7.jpg
  99. 二進制
      dev/static/center/maptile/7/16/8.jpg
  100. 0
    0
      dev/static/center/maptile/7/16/9.jpg

+ 3
- 0
.babelrc 查看文件

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

+ 40
- 0
.eslintrc.json 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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>

+ 348
- 0
config/config.js 查看文件

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

+ 28
- 0
config/pathVars.js 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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
+};

二進制
dev/static/center/maptile/4/1/0.jpg 查看文件


二進制
dev/static/center/maptile/4/1/1.jpg 查看文件


二進制
dev/static/center/maptile/4/2/0.jpg 查看文件


二進制
dev/static/center/maptile/4/2/1.jpg 查看文件


二進制
dev/static/center/maptile/4/3/0.jpg 查看文件


二進制
dev/static/center/maptile/4/3/1.jpg 查看文件


二進制
dev/static/center/maptile/5/1/1.jpg 查看文件


二進制
dev/static/center/maptile/5/1/2.jpg 查看文件


二進制
dev/static/center/maptile/5/3/1.jpg 查看文件


二進制
dev/static/center/maptile/5/3/2.jpg 查看文件


二進制
dev/static/center/maptile/5/3/3.jpg 查看文件


二進制
dev/static/center/maptile/5/4/1.jpg 查看文件


二進制
dev/static/center/maptile/5/4/2.jpg 查看文件


二進制
dev/static/center/maptile/5/4/3.jpg 查看文件


二進制
dev/static/center/maptile/5/5/1.jpg 查看文件


二進制
dev/static/center/maptile/5/5/2.jpg 查看文件


二進制
dev/static/center/maptile/5/5/3.jpg 查看文件


二進制
dev/static/center/maptile/5/6/1.jpg 查看文件


二進制
dev/static/center/maptile/5/6/2.jpg 查看文件


二進制
dev/static/center/maptile/5/6/3.jpg 查看文件


二進制
dev/static/center/maptile/5/7/1.jpg 查看文件


二進制
dev/static/center/maptile/5/7/2.jpg 查看文件


二進制
dev/static/center/maptile/5/7/3.jpg 查看文件


二進制
dev/static/center/maptile/6/10/2.jpg 查看文件


二進制
dev/static/center/maptile/6/10/3.jpg 查看文件


二進制
dev/static/center/maptile/6/10/4.jpg 查看文件


二進制
dev/static/center/maptile/6/10/5.jpg 查看文件


二進制
dev/static/center/maptile/6/10/6.jpg 查看文件


二進制
dev/static/center/maptile/6/11/2.jpg 查看文件


二進制
dev/static/center/maptile/6/11/3.jpg 查看文件


二進制
dev/static/center/maptile/6/11/4.jpg 查看文件


二進制
dev/static/center/maptile/6/11/5.jpg 查看文件


二進制
dev/static/center/maptile/6/11/6.jpg 查看文件


二進制
dev/static/center/maptile/6/12/2.jpg 查看文件


二進制
dev/static/center/maptile/6/12/3.jpg 查看文件


二進制
dev/static/center/maptile/6/12/4.jpg 查看文件


二進制
dev/static/center/maptile/6/12/5.jpg 查看文件


二進制
dev/static/center/maptile/6/12/6.jpg 查看文件


二進制
dev/static/center/maptile/6/13/2.jpg 查看文件


二進制
dev/static/center/maptile/6/13/3.jpg 查看文件


二進制
dev/static/center/maptile/6/13/4.jpg 查看文件


二進制
dev/static/center/maptile/6/13/5.jpg 查看文件


二進制
dev/static/center/maptile/6/13/6.jpg 查看文件


二進制
dev/static/center/maptile/6/14/2.jpg 查看文件


二進制
dev/static/center/maptile/6/14/3.jpg 查看文件


二進制
dev/static/center/maptile/6/14/4.jpg 查看文件


二進制
dev/static/center/maptile/6/14/5.jpg 查看文件


二進制
dev/static/center/maptile/6/14/6.jpg 查看文件


二進制
dev/static/center/maptile/6/7/2.jpg 查看文件


二進制
dev/static/center/maptile/6/7/3.jpg 查看文件


二進制
dev/static/center/maptile/6/7/4.jpg 查看文件


二進制
dev/static/center/maptile/6/7/5.jpg 查看文件


二進制
dev/static/center/maptile/6/7/6.jpg 查看文件


二進制
dev/static/center/maptile/6/8/2.jpg 查看文件


二進制
dev/static/center/maptile/6/8/3.jpg 查看文件


二進制
dev/static/center/maptile/6/8/4.jpg 查看文件


二進制
dev/static/center/maptile/6/8/5.jpg 查看文件


二進制
dev/static/center/maptile/6/8/6.jpg 查看文件


二進制
dev/static/center/maptile/6/9/2.jpg 查看文件


二進制
dev/static/center/maptile/6/9/3.jpg 查看文件


二進制
dev/static/center/maptile/6/9/4.jpg 查看文件


二進制
dev/static/center/maptile/6/9/5.jpg 查看文件


二進制
dev/static/center/maptile/6/9/6.jpg 查看文件


二進制
dev/static/center/maptile/7/15/10.jpg 查看文件


二進制
dev/static/center/maptile/7/15/11.jpg 查看文件


二進制
dev/static/center/maptile/7/15/12.jpg 查看文件


二進制
dev/static/center/maptile/7/15/13.jpg 查看文件


二進制
dev/static/center/maptile/7/15/4.jpg 查看文件


二進制
dev/static/center/maptile/7/15/5.jpg 查看文件


二進制
dev/static/center/maptile/7/15/6.jpg 查看文件


二進制
dev/static/center/maptile/7/15/7.jpg 查看文件


二進制
dev/static/center/maptile/7/15/8.jpg 查看文件


二進制
dev/static/center/maptile/7/15/9.jpg 查看文件


二進制
dev/static/center/maptile/7/16/10.jpg 查看文件


二進制
dev/static/center/maptile/7/16/11.jpg 查看文件


二進制
dev/static/center/maptile/7/16/12.jpg 查看文件


二進制
dev/static/center/maptile/7/16/13.jpg 查看文件


二進制
dev/static/center/maptile/7/16/4.jpg 查看文件


二進制
dev/static/center/maptile/7/16/5.jpg 查看文件


二進制
dev/static/center/maptile/7/16/6.jpg 查看文件


二進制
dev/static/center/maptile/7/16/7.jpg 查看文件


二進制
dev/static/center/maptile/7/16/8.jpg 查看文件


+ 0
- 0
dev/static/center/maptile/7/16/9.jpg 查看文件


部分文件因文件數量過多而無法顯示

Loading…
取消
儲存