centaline-data-driven 1.1.51 → 1.1.55

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.
Files changed (193) hide show
  1. package/.babelrc +12 -12
  2. package/.editorconfig +9 -9
  3. package/.gitattributes +63 -63
  4. package/.postcssrc.js +10 -10
  5. package/Centaline.Front_End.DataDriven.csproj +37 -37
  6. package/Centaline.Front_End.DataDriven.sln +25 -25
  7. package/Properties/launchSettings.json +26 -26
  8. package/README.md +140 -140
  9. package/build/build.js +41 -41
  10. package/build/centaline/centaline.path.js +59 -59
  11. package/build/centaline/webpack.centaline.conf.js +106 -106
  12. package/build/check-versions.js +54 -54
  13. package/build/utils.js +102 -102
  14. package/build/vue-loader.conf.js +22 -22
  15. package/build/webpack.base.conf.js +82 -82
  16. package/build/webpack.dev.conf.js +111 -111
  17. package/build/webpack.prod.conf.js +145 -145
  18. package/config/dev.env.js +12 -12
  19. package/config/index.js +73 -73
  20. package/config/prod.env.js +4 -4
  21. package/index.html +14 -14
  22. package/package.json +75 -75
  23. package/src/App.vue +10 -10
  24. package/src/Detail.vue +26 -26
  25. package/src/Edit.vue +32 -66
  26. package/src/Form.vue +29 -30
  27. package/src/SearchList.vue +40 -40
  28. package/src/SearchTree.vue +51 -51
  29. package/src/Tabs.vue +19 -19
  30. package/src/centaline/api/index.js +249 -249
  31. package/src/centaline/comfirm/index.js +11 -11
  32. package/src/centaline/comfirm/src/comfirm.vue +44 -44
  33. package/src/centaline/common/index.js +738 -738
  34. package/src/centaline/css/common.css +749 -738
  35. package/src/centaline/css/max.css +208 -204
  36. package/src/centaline/dialogList/index.js +11 -11
  37. package/src/centaline/dialogList/src/dialog.vue +210 -207
  38. package/src/centaline/dialogList/src/dialogList.vue +65 -65
  39. package/src/centaline/dialogList/src/dialogNew.vue +78 -78
  40. package/src/centaline/dialogList/src/drag.js +77 -77
  41. package/src/centaline/directives/index.js +23 -23
  42. package/src/centaline/dynamicBtn/index.js +11 -11
  43. package/src/centaline/dynamicBtn/src/dynamicBtn.vue +100 -100
  44. package/src/centaline/dynamicCb/index.js +11 -11
  45. package/src/centaline/dynamicCb/src/dynamicCb.vue +72 -72
  46. package/src/centaline/dynamicCheckbox/index.js +11 -11
  47. package/src/centaline/dynamicCheckbox/src/dynamicCheckbox.vue +128 -128
  48. package/src/centaline/dynamicComboBoxWithTextBox/index.js +11 -11
  49. package/src/centaline/dynamicComboBoxWithTextBox/src/dynamicComboBoxWithTextBox.vue +240 -240
  50. package/src/centaline/dynamicD/index.js +11 -11
  51. package/src/centaline/dynamicD/src/dynamicD.vue +92 -92
  52. package/src/centaline/dynamicDetail/index.js +10 -10
  53. package/src/centaline/dynamicDetail/src/dynamicDetail.vue +40 -40
  54. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailOFI.vue +1280 -1280
  55. package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +1293 -1295
  56. package/src/centaline/dynamicDrop/index.js +11 -11
  57. package/src/centaline/dynamicDrop/src/dynamicDrop.vue +54 -54
  58. package/src/centaline/dynamicDtd/index.js +11 -11
  59. package/src/centaline/dynamicDtd/src/dynamicDtd.vue +125 -125
  60. package/src/centaline/dynamicDtd/src/dynamicDtdOld.vue +93 -93
  61. package/src/centaline/dynamicFile/index.js +11 -11
  62. package/src/centaline/dynamicFile/src/dynamicFile.vue +288 -283
  63. package/src/centaline/dynamicForm/index.js +24 -24
  64. package/src/centaline/dynamicForm/src/dynamicForm.vue +564 -536
  65. package/src/centaline/dynamicForm/src/dynamicFormList.vue +209 -209
  66. package/src/centaline/dynamicForm/src/dynamicFormListTable.vue +376 -376
  67. package/src/centaline/dynamicGp/index.js +11 -11
  68. package/src/centaline/dynamicGp/src/dynamicGp.vue +27 -27
  69. package/src/centaline/dynamicHyperLink/index.js +11 -11
  70. package/src/centaline/dynamicHyperLink/src/dynamicHyperLink.vue +54 -54
  71. package/src/centaline/dynamicInput/index.js +35 -35
  72. package/src/centaline/dynamicInput/src/dynamicInput.vue +35 -35
  73. package/src/centaline/dynamicInputNumber/index.js +11 -11
  74. package/src/centaline/dynamicInputNumber/src/dynamicInputNumber.vue +157 -157
  75. package/src/centaline/dynamicIti/index.js +11 -11
  76. package/src/centaline/dynamicIti/src/dynamicIti.vue +148 -148
  77. package/src/centaline/dynamicL/index.js +11 -11
  78. package/src/centaline/dynamicL/src/dynamicL.vue +37 -37
  79. package/src/centaline/dynamicLabel/index.js +11 -11
  80. package/src/centaline/dynamicLabel/src/dynamicLabel.vue +73 -73
  81. package/src/centaline/dynamicLs/index.js +22 -22
  82. package/src/centaline/dynamicLs/src/dynamicLs.vue +233 -233
  83. package/src/centaline/dynamicMo/index.js +13 -13
  84. package/src/centaline/dynamicMo/src/dynamicMo.vue +421 -421
  85. package/src/centaline/dynamicMt/index.js +11 -11
  86. package/src/centaline/dynamicMt/src/dynamicMt.vue +44 -44
  87. package/src/centaline/dynamicPlaceHolder/index.js +11 -11
  88. package/src/centaline/dynamicPlaceHolder/src/dynamicPlaceHolder.vue +29 -29
  89. package/src/centaline/dynamicPopupSearchList/index.js +11 -11
  90. package/src/centaline/dynamicPopupSearchList/src/dynamicPopupSearchList.vue +157 -157
  91. package/src/centaline/dynamicPopupSearchList/src/dynamicPopupSearchListTable.vue +239 -237
  92. package/src/centaline/dynamicRichText/index.js +11 -11
  93. package/src/centaline/dynamicRichText/src/dynamicRichText.vue +33 -33
  94. package/src/centaline/dynamicSearchList/index.js +11 -11
  95. package/src/centaline/dynamicSearchList/src/dynamicSearchCategory.vue +121 -121
  96. package/src/centaline/dynamicSearchList/src/dynamicSearchList.vue +135 -135
  97. package/src/centaline/dynamicSearchList/src/dynamicSearchScreen.vue +206 -206
  98. package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +1069 -1069
  99. package/src/centaline/dynamicSearchList/src/dynamicTableStatistics.vue +41 -41
  100. package/src/centaline/dynamicSearchList/src/dynamicTableTip.vue +46 -46
  101. package/src/centaline/dynamicSearchList/src/dynamicTableToolbar.vue +61 -61
  102. package/src/centaline/dynamicSeg/index.js +11 -11
  103. package/src/centaline/dynamicSeg/src/dynamicSeg.vue +100 -100
  104. package/src/centaline/dynamicSensitiveEye/index.js +11 -11
  105. package/src/centaline/dynamicSensitiveEye/src/dynamicSensitiveEye.vue +74 -74
  106. package/src/centaline/dynamicSo/index.js +14 -14
  107. package/src/centaline/dynamicSo/src/dynamicSo.vue +328 -328
  108. package/src/centaline/dynamicSo/src/dynamicSo/345/211/257/346/234/254.vue +69 -69
  109. package/src/centaline/dynamicSos/index.js +14 -14
  110. package/src/centaline/dynamicSos/src/dynamicSos - /345/244/215/345/210/266.vue" +223 -223
  111. package/src/centaline/dynamicSos/src/dynamicSos.vue +260 -260
  112. package/src/centaline/dynamicSw/index.js +11 -11
  113. package/src/centaline/dynamicSw/src/dynamicSw.vue +74 -74
  114. package/src/centaline/dynamicT/index.js +11 -11
  115. package/src/centaline/dynamicT/src/dynamicT.vue +79 -79
  116. package/src/centaline/dynamicTab/index.js +11 -11
  117. package/src/centaline/dynamicTab/src/dynamicTab.vue +49 -49
  118. package/src/centaline/dynamicTabs/index.js +11 -11
  119. package/src/centaline/dynamicTabs/src/dynamicTabs.vue +69 -69
  120. package/src/centaline/dynamicTags/index.js +13 -13
  121. package/src/centaline/dynamicTags/src/dynamicTags - /345/244/215/345/210/266.vue" +391 -391
  122. package/src/centaline/dynamicTags/src/dynamicTags.vue +427 -427
  123. package/src/centaline/dynamicTimeSelect/index.js +11 -11
  124. package/src/centaline/dynamicTimeSelect/src/dynamicTimeSelect.vue +141 -141
  125. package/src/centaline/dynamicTree/index.js +11 -11
  126. package/src/centaline/dynamicTree/src/dynamicSearchTree.vue +66 -66
  127. package/src/centaline/dynamicTree/src/dynamicTree.vue +233 -233
  128. package/src/centaline/dynamicTree/src/dynamicTreeList.vue +74 -74
  129. package/src/centaline/formData/index.js +290 -290
  130. package/src/centaline/imgPreview/index.js +42 -42
  131. package/src/centaline/imgPreview/src/imgPreview.vue +26 -26
  132. package/src/centaline/index.js +51 -51
  133. package/src/centaline/loader/index.js +157 -157
  134. package/src/centaline/loader/src/ctl/Base.js +261 -261
  135. package/src/centaline/loader/src/ctl/Button.js +44 -44
  136. package/src/centaline/loader/src/ctl/Cb.js +27 -27
  137. package/src/centaline/loader/src/ctl/Checkbox.js +107 -107
  138. package/src/centaline/loader/src/ctl/ComboBoxWithTextBox.js +162 -162
  139. package/src/centaline/loader/src/ctl/D.js +31 -31
  140. package/src/centaline/loader/src/ctl/Detail.js +175 -175
  141. package/src/centaline/loader/src/ctl/Dtd.js +115 -115
  142. package/src/centaline/loader/src/ctl/DtdOld.js +129 -129
  143. package/src/centaline/loader/src/ctl/File.js +292 -292
  144. package/src/centaline/loader/src/ctl/Form.js +380 -363
  145. package/src/centaline/loader/src/ctl/FormList.js +428 -428
  146. package/src/centaline/loader/src/ctl/GM.js +20 -20
  147. package/src/centaline/loader/src/ctl/Gp.js +9 -9
  148. package/src/centaline/loader/src/ctl/Hd.js +13 -13
  149. package/src/centaline/loader/src/ctl/HyperLink.js +24 -24
  150. package/src/centaline/loader/src/ctl/InputNumber.js +51 -51
  151. package/src/centaline/loader/src/ctl/Iti.js +108 -108
  152. package/src/centaline/loader/src/ctl/L.js +18 -18
  153. package/src/centaline/loader/src/ctl/Mo.js +183 -183
  154. package/src/centaline/loader/src/ctl/Mt.js +20 -20
  155. package/src/centaline/loader/src/ctl/PlaceHolder.js +17 -17
  156. package/src/centaline/loader/src/ctl/Router.js +273 -273
  157. package/src/centaline/loader/src/ctl/SearchCategory.js +54 -54
  158. package/src/centaline/loader/src/ctl/SearchScreen.js +236 -236
  159. package/src/centaline/loader/src/ctl/SearchTable.js +772 -772
  160. package/src/centaline/loader/src/ctl/Seg.js +37 -37
  161. package/src/centaline/loader/src/ctl/SensitiveEye.js +65 -65
  162. package/src/centaline/loader/src/ctl/So.js +117 -117
  163. package/src/centaline/loader/src/ctl/Sos.js +128 -128
  164. package/src/centaline/loader/src/ctl/Sw.js +27 -27
  165. package/src/centaline/loader/src/ctl/T.js +65 -65
  166. package/src/centaline/loader/src/ctl/Tabs.js +57 -57
  167. package/src/centaline/loader/src/ctl/Tags.js +191 -191
  168. package/src/centaline/loader/src/ctl/TimeSelect.js +87 -87
  169. package/src/centaline/loader/src/ctl/Tree.js +151 -151
  170. package/src/centaline/loader/src/ctl/Ttts.js +78 -78
  171. package/src/centaline/loader/src/ctl/lib/Enum.js +563 -563
  172. package/src/centaline/loader/src/ctl/lib/LibFunction.js +364 -364
  173. package/src/centaline/loader/src/ctl.js +36 -35
  174. package/src/centaline/mixins/dynamicElement.js +151 -151
  175. package/src/centaline/mixins/dynamicSelect.js +84 -84
  176. package/src/centaline/mixins/emitter.js +33 -33
  177. package/src/centaline/progress/index.js +11 -11
  178. package/src/centaline/progress/src/progress.vue +70 -70
  179. package/src/centaline/quickInput/src/quickInput.vue +64 -64
  180. package/src/centaline/selectOption/src/selectOption.vue +61 -61
  181. package/src/centaline/selectOption/src/selectOptionVertical.vue +80 -80
  182. package/src/centaline/templateControls/index.js +17 -17
  183. package/src/centaline/templateControls/src/dynamicTableA.vue +20 -20
  184. package/src/centaline/templateControls/src/dynamicTableCurrency.vue +62 -62
  185. package/src/centaline/templateControls/src/dynamicTableImg.vue +25 -25
  186. package/src/centaline/templates/index.js +34 -34
  187. package/src/centaline/templates/src/ContractSearch.js +67 -67
  188. package/src/centaline/templates/src/test.js +44 -44
  189. package/src/centaline/validate/index.js +332 -332
  190. package/src/main.js +46 -48
  191. package/src/router/index.js +44 -44
  192. package/wwwroot/static/centaline/centaline-data-driven.js +1 -1
  193. package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
package/build/utils.js CHANGED
@@ -1,102 +1,102 @@
1
- 'use strict'
2
- const path = require('path')
3
- const config = require('../config')
4
- const ExtractTextPlugin = require('extract-text-webpack-plugin')
5
- const packageConfig = require('../package.json')
6
-
7
- exports.assetsPath = function (_path) {
8
- const assetsSubDirectory = process.env.NODE_ENV === 'production'
9
- ? config.build.assetsSubDirectory
10
- : config.dev.assetsSubDirectory
11
-
12
- return path.posix.join(assetsSubDirectory, _path)
13
- }
14
-
15
- exports.cssLoaders = function (options) {
16
- options = options || {}
17
-
18
- const cssLoader = {
19
- loader: 'css-loader',
20
- options: {
21
- sourceMap: options.sourceMap
22
- }
23
- }
24
-
25
- const postcssLoader = {
26
- loader: 'postcss-loader',
27
- options: {
28
- sourceMap: options.sourceMap
29
- }
30
- }
31
-
32
- // generate loader string to be used with extract text plugin
33
- function generateLoaders (loader, loaderOptions) {
34
- const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
35
-
36
- if (loader) {
37
- loaders.push({
38
- loader: loader + '-loader',
39
- options: Object.assign({}, loaderOptions, {
40
- sourceMap: options.sourceMap
41
- })
42
- })
43
- }
44
-
45
- // Extract CSS when that option is specified
46
- // (which is the case during production build)
47
- if (options.extract) {
48
- return ExtractTextPlugin.extract({
49
- use: loaders,
50
- fallback: 'vue-style-loader',
51
- publicPath:'../../'
52
- })
53
- } else {
54
- return ['vue-style-loader'].concat(loaders)
55
- }
56
- }
57
-
58
- // https://vue-loader.vuejs.org/en/configurations/extract-css.html
59
- return {
60
- css: generateLoaders(),
61
- postcss: generateLoaders(),
62
- less: generateLoaders('less'),
63
- sass: generateLoaders('sass', { indentedSyntax: true }),
64
- scss: generateLoaders('sass'),
65
- stylus: generateLoaders('stylus'),
66
- styl: generateLoaders('stylus')
67
- }
68
- }
69
-
70
- // Generate loaders for standalone style files (outside of .vue)
71
- exports.styleLoaders = function (options) {
72
- const output = []
73
- const loaders = exports.cssLoaders(options)
74
-
75
- for (const extension in loaders) {
76
- const loader = loaders[extension]
77
- output.push({
78
- test: new RegExp('\\.' + extension + '$'),
79
- use: loader
80
- })
81
- }
82
-
83
- return output
84
- }
85
-
86
- exports.createNotifierCallback = () => {
87
- const notifier = require('node-notifier')
88
-
89
- return (severity, errors) => {
90
- if (severity !== 'error') return
91
-
92
- const error = errors[0]
93
- const filename = error.file && error.file.split('!').pop()
94
-
95
- notifier.notify({
96
- title: packageConfig.name,
97
- message: severity + ': ' + error.name,
98
- subtitle: filename || '',
99
- icon: path.join(__dirname, 'logo.png')
100
- })
101
- }
102
- }
1
+ 'use strict'
2
+ const path = require('path')
3
+ const config = require('../config')
4
+ const ExtractTextPlugin = require('extract-text-webpack-plugin')
5
+ const packageConfig = require('../package.json')
6
+
7
+ exports.assetsPath = function (_path) {
8
+ const assetsSubDirectory = process.env.NODE_ENV === 'production'
9
+ ? config.build.assetsSubDirectory
10
+ : config.dev.assetsSubDirectory
11
+
12
+ return path.posix.join(assetsSubDirectory, _path)
13
+ }
14
+
15
+ exports.cssLoaders = function (options) {
16
+ options = options || {}
17
+
18
+ const cssLoader = {
19
+ loader: 'css-loader',
20
+ options: {
21
+ sourceMap: options.sourceMap
22
+ }
23
+ }
24
+
25
+ const postcssLoader = {
26
+ loader: 'postcss-loader',
27
+ options: {
28
+ sourceMap: options.sourceMap
29
+ }
30
+ }
31
+
32
+ // generate loader string to be used with extract text plugin
33
+ function generateLoaders (loader, loaderOptions) {
34
+ const loaders = options.usePostCSS ? [cssLoader, postcssLoader] : [cssLoader]
35
+
36
+ if (loader) {
37
+ loaders.push({
38
+ loader: loader + '-loader',
39
+ options: Object.assign({}, loaderOptions, {
40
+ sourceMap: options.sourceMap
41
+ })
42
+ })
43
+ }
44
+
45
+ // Extract CSS when that option is specified
46
+ // (which is the case during production build)
47
+ if (options.extract) {
48
+ return ExtractTextPlugin.extract({
49
+ use: loaders,
50
+ fallback: 'vue-style-loader',
51
+ publicPath:'../../'
52
+ })
53
+ } else {
54
+ return ['vue-style-loader'].concat(loaders)
55
+ }
56
+ }
57
+
58
+ // https://vue-loader.vuejs.org/en/configurations/extract-css.html
59
+ return {
60
+ css: generateLoaders(),
61
+ postcss: generateLoaders(),
62
+ less: generateLoaders('less'),
63
+ sass: generateLoaders('sass', { indentedSyntax: true }),
64
+ scss: generateLoaders('sass'),
65
+ stylus: generateLoaders('stylus'),
66
+ styl: generateLoaders('stylus')
67
+ }
68
+ }
69
+
70
+ // Generate loaders for standalone style files (outside of .vue)
71
+ exports.styleLoaders = function (options) {
72
+ const output = []
73
+ const loaders = exports.cssLoaders(options)
74
+
75
+ for (const extension in loaders) {
76
+ const loader = loaders[extension]
77
+ output.push({
78
+ test: new RegExp('\\.' + extension + '$'),
79
+ use: loader
80
+ })
81
+ }
82
+
83
+ return output
84
+ }
85
+
86
+ exports.createNotifierCallback = () => {
87
+ const notifier = require('node-notifier')
88
+
89
+ return (severity, errors) => {
90
+ if (severity !== 'error') return
91
+
92
+ const error = errors[0]
93
+ const filename = error.file && error.file.split('!').pop()
94
+
95
+ notifier.notify({
96
+ title: packageConfig.name,
97
+ message: severity + ': ' + error.name,
98
+ subtitle: filename || '',
99
+ icon: path.join(__dirname, 'logo.png')
100
+ })
101
+ }
102
+ }
@@ -1,22 +1,22 @@
1
- 'use strict'
2
- const utils = require('./utils')
3
- const config = require('../config')
4
- const isProduction = process.env.NODE_ENV === 'production'
5
- const sourceMapEnabled = isProduction
6
- ? config.build.productionSourceMap
7
- : config.dev.cssSourceMap
8
-
9
- module.exports = {
10
- loaders: utils.cssLoaders({
11
- sourceMap: sourceMapEnabled,
12
- extract: isProduction
13
- }),
14
- cssSourceMap: sourceMapEnabled,
15
- cacheBusting: config.dev.cacheBusting,
16
- transformToRequire: {
17
- video: ['src', 'poster'],
18
- source: 'src',
19
- img: 'src',
20
- image: 'xlink:href'
21
- }
22
- }
1
+ 'use strict'
2
+ const utils = require('./utils')
3
+ const config = require('../config')
4
+ const isProduction = process.env.NODE_ENV === 'production'
5
+ const sourceMapEnabled = isProduction
6
+ ? config.build.productionSourceMap
7
+ : config.dev.cssSourceMap
8
+
9
+ module.exports = {
10
+ loaders: utils.cssLoaders({
11
+ sourceMap: sourceMapEnabled,
12
+ extract: isProduction
13
+ }),
14
+ cssSourceMap: sourceMapEnabled,
15
+ cacheBusting: config.dev.cacheBusting,
16
+ transformToRequire: {
17
+ video: ['src', 'poster'],
18
+ source: 'src',
19
+ img: 'src',
20
+ image: 'xlink:href'
21
+ }
22
+ }
@@ -1,82 +1,82 @@
1
- 'use strict'
2
- const path = require('path')
3
- const utils = require('./utils')
4
- const config = require('../config')
5
- const vueLoaderConfig = require('./vue-loader.conf')
6
-
7
- function resolve (dir) {
8
- return path.join(__dirname, '..', dir)
9
- }
10
-
11
-
12
-
13
- module.exports = {
14
- context: path.resolve(__dirname, '../'),
15
- entry: {
16
- app: './src/main.js'
17
- },
18
- output: {
19
- path: config.build.assetsRoot,
20
- filename: '[name].js',
21
- publicPath: process.env.NODE_ENV === 'production'
22
- ? config.build.assetsPublicPath
23
- : config.dev.assetsPublicPath
24
- },
25
- resolve: {
26
- extensions: ['.js', '.vue', '.json'],
27
- alias: {
28
- 'vue$': 'vue/dist/vue.esm.js',
29
- '@': resolve('src')
30
- }
31
- },
32
- module: {
33
- rules: [
34
- {
35
- test: /\.vue$/,
36
- loader: 'vue-loader',
37
- options: vueLoaderConfig
38
- },
39
- {
40
- test: /\.js$/,
41
- loader: 'babel-loader',
42
- include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
43
- },
44
- {
45
- test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
46
- loader: 'url-loader',
47
- options: {
48
- limit: 10000,
49
- name: utils.assetsPath('img/[name].[hash:7].[ext]')
50
- }
51
- },
52
- {
53
- test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
54
- loader: 'url-loader',
55
- options: {
56
- limit: 10000,
57
- name: utils.assetsPath('media/[name].[hash:7].[ext]')
58
- }
59
- },
60
- {
61
- test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
62
- loader: 'url-loader',
63
- options: {
64
- limit: 10000,
65
- name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
66
- }
67
- }
68
- ]
69
- },
70
- node: {
71
- // prevent webpack from injecting useless setImmediate polyfill because Vue
72
- // source contains it (although only uses it if it's native).
73
- setImmediate: false,
74
- // prevent webpack from injecting mocks to Node native modules
75
- // that does not make sense for the client
76
- dgram: 'empty',
77
- fs: 'empty',
78
- net: 'empty',
79
- tls: 'empty',
80
- child_process: 'empty'
81
- }
82
- }
1
+ 'use strict'
2
+ const path = require('path')
3
+ const utils = require('./utils')
4
+ const config = require('../config')
5
+ const vueLoaderConfig = require('./vue-loader.conf')
6
+
7
+ function resolve (dir) {
8
+ return path.join(__dirname, '..', dir)
9
+ }
10
+
11
+
12
+
13
+ module.exports = {
14
+ context: path.resolve(__dirname, '../'),
15
+ entry: {
16
+ app: './src/main.js'
17
+ },
18
+ output: {
19
+ path: config.build.assetsRoot,
20
+ filename: '[name].js',
21
+ publicPath: process.env.NODE_ENV === 'production'
22
+ ? config.build.assetsPublicPath
23
+ : config.dev.assetsPublicPath
24
+ },
25
+ resolve: {
26
+ extensions: ['.js', '.vue', '.json'],
27
+ alias: {
28
+ 'vue$': 'vue/dist/vue.esm.js',
29
+ '@': resolve('src')
30
+ }
31
+ },
32
+ module: {
33
+ rules: [
34
+ {
35
+ test: /\.vue$/,
36
+ loader: 'vue-loader',
37
+ options: vueLoaderConfig
38
+ },
39
+ {
40
+ test: /\.js$/,
41
+ loader: 'babel-loader',
42
+ include: [resolve('src'), resolve('test'), resolve('node_modules/webpack-dev-server/client')]
43
+ },
44
+ {
45
+ test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
46
+ loader: 'url-loader',
47
+ options: {
48
+ limit: 10000,
49
+ name: utils.assetsPath('img/[name].[hash:7].[ext]')
50
+ }
51
+ },
52
+ {
53
+ test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
54
+ loader: 'url-loader',
55
+ options: {
56
+ limit: 10000,
57
+ name: utils.assetsPath('media/[name].[hash:7].[ext]')
58
+ }
59
+ },
60
+ {
61
+ test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
62
+ loader: 'url-loader',
63
+ options: {
64
+ limit: 10000,
65
+ name: utils.assetsPath('fonts/[name].[hash:7].[ext]')
66
+ }
67
+ }
68
+ ]
69
+ },
70
+ node: {
71
+ // prevent webpack from injecting useless setImmediate polyfill because Vue
72
+ // source contains it (although only uses it if it's native).
73
+ setImmediate: false,
74
+ // prevent webpack from injecting mocks to Node native modules
75
+ // that does not make sense for the client
76
+ dgram: 'empty',
77
+ fs: 'empty',
78
+ net: 'empty',
79
+ tls: 'empty',
80
+ child_process: 'empty'
81
+ }
82
+ }
@@ -1,111 +1,111 @@
1
- 'use strict'
2
- const utils = require('./utils')
3
- const webpack = require('webpack')
4
- const config = require('../config')
5
- const merge = require('webpack-merge')
6
- const path = require('path')
7
- const baseWebpackConfig = require('./webpack.base.conf')
8
- const CopyWebpackPlugin = require('copy-webpack-plugin')
9
- const HtmlWebpackPlugin = require('html-webpack-plugin')
10
- const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
11
- const portfinder = require('portfinder')
12
-
13
- const HOST = process.env.HOST
14
- const PORT = process.env.PORT && Number(process.env.PORT)
15
-
16
- const devWebpackConfig = merge(baseWebpackConfig, {
17
- module: {
18
- rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
19
- },
20
- // cheap-module-eval-source-map is faster for development
21
- devtool: config.dev.devtool,
22
-
23
- // these devServer options should be customized in /config/index.js
24
- devServer: {
25
- clientLogLevel: 'warning',
26
- historyApiFallback: {
27
- rewrites: [
28
- { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
29
- ],
30
- },
31
- hot: true,
32
- contentBase: false, // since we use CopyWebpackPlugin.
33
- compress: true,
34
- host: HOST || config.dev.host,
35
- port: PORT || config.dev.port,
36
- open: config.dev.autoOpenBrowser,
37
- overlay: config.dev.errorOverlay
38
- ? { warnings: false, errors: true }
39
- : false,
40
- publicPath: config.dev.assetsPublicPath,
41
- //proxy: config.dev.proxyTable,
42
- quiet: true, // necessary for FriendlyErrorsPlugin
43
- watchOptions: {
44
- poll: config.dev.poll,
45
- },
46
- //proxy: {
47
- // "/gateway": {
48
- // target: "http://10.88.23.29:5000", //对应服务端的接口地址
49
- // changeOrigin: true, // 开启跨域
50
- // pathRewrite: {
51
- // "^/gateway": "/gateway" //将以 /gateway 开头的接口重写http://116.66.65.193:8081/gateway ,调用时直接以 /gateway开头即表示调用http://116.66.65.193:8081/gateway
52
- // }
53
- // },
54
- // "/api": {
55
- // target: "http://10.1.245.37:5208", //对应服务端的接口地址
56
- // changeOrigin: true, // 开启跨域
57
- // pathRewrite: {
58
- // "^/api": "/api" //将以 /gateway 开头的接口重写http://116.66.65.193:8081/gateway ,调用时直接以 /gateway开头即表示调用http://116.66.65.193:8081/gateway
59
- // }
60
- // }
61
- //}
62
- },
63
- plugins: [
64
- new webpack.DefinePlugin({
65
- 'process.env': require('../config/dev.env')
66
- }),
67
- new webpack.HotModuleReplacementPlugin(),
68
- new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
69
- new webpack.NoEmitOnErrorsPlugin(),
70
- // https://github.com/ampedandwired/html-webpack-plugin
71
- new HtmlWebpackPlugin({
72
- filename: 'index.html',
73
- template: 'index.html',
74
- inject: true
75
- }),
76
- // copy custom static assets
77
- new CopyWebpackPlugin([
78
- {
79
- from: path.resolve(__dirname, '../static'),
80
- to: config.dev.assetsSubDirectory,
81
- ignore: ['.*']
82
- }
83
- ])
84
- ]
85
- })
86
-
87
- module.exports = new Promise((resolve, reject) => {
88
- portfinder.basePort = process.env.PORT || config.dev.port
89
- portfinder.getPort((err, port) => {
90
- if (err) {
91
- reject(err)
92
- } else {
93
- // publish the new Port, necessary for e2e tests
94
- process.env.PORT = port
95
- // add port to devServer config
96
- devWebpackConfig.devServer.port = port
97
-
98
- // Add FriendlyErrorsPlugin
99
- devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
100
- compilationSuccessInfo: {
101
- messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
102
- },
103
- onErrors: config.dev.notifyOnErrors
104
- ? utils.createNotifierCallback()
105
- : undefined
106
- }))
107
-
108
- resolve(devWebpackConfig)
109
- }
110
- })
111
- })
1
+ 'use strict'
2
+ const utils = require('./utils')
3
+ const webpack = require('webpack')
4
+ const config = require('../config')
5
+ const merge = require('webpack-merge')
6
+ const path = require('path')
7
+ const baseWebpackConfig = require('./webpack.base.conf')
8
+ const CopyWebpackPlugin = require('copy-webpack-plugin')
9
+ const HtmlWebpackPlugin = require('html-webpack-plugin')
10
+ const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
11
+ const portfinder = require('portfinder')
12
+
13
+ const HOST = process.env.HOST
14
+ const PORT = process.env.PORT && Number(process.env.PORT)
15
+
16
+ const devWebpackConfig = merge(baseWebpackConfig, {
17
+ module: {
18
+ rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
19
+ },
20
+ // cheap-module-eval-source-map is faster for development
21
+ devtool: config.dev.devtool,
22
+
23
+ // these devServer options should be customized in /config/index.js
24
+ devServer: {
25
+ clientLogLevel: 'warning',
26
+ historyApiFallback: {
27
+ rewrites: [
28
+ { from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
29
+ ],
30
+ },
31
+ hot: true,
32
+ contentBase: false, // since we use CopyWebpackPlugin.
33
+ compress: true,
34
+ host: HOST || config.dev.host,
35
+ port: PORT || config.dev.port,
36
+ open: config.dev.autoOpenBrowser,
37
+ overlay: config.dev.errorOverlay
38
+ ? { warnings: false, errors: true }
39
+ : false,
40
+ publicPath: config.dev.assetsPublicPath,
41
+ //proxy: config.dev.proxyTable,
42
+ quiet: true, // necessary for FriendlyErrorsPlugin
43
+ watchOptions: {
44
+ poll: config.dev.poll,
45
+ },
46
+ //proxy: {
47
+ // "/gateway": {
48
+ // target: "http://10.88.23.29:5000", //对应服务端的接口地址
49
+ // changeOrigin: true, // 开启跨域
50
+ // pathRewrite: {
51
+ // "^/gateway": "/gateway" //将以 /gateway 开头的接口重写http://116.66.65.193:8081/gateway ,调用时直接以 /gateway开头即表示调用http://116.66.65.193:8081/gateway
52
+ // }
53
+ // },
54
+ // "/api": {
55
+ // target: "http://10.1.245.37:5208", //对应服务端的接口地址
56
+ // changeOrigin: true, // 开启跨域
57
+ // pathRewrite: {
58
+ // "^/api": "/api" //将以 /gateway 开头的接口重写http://116.66.65.193:8081/gateway ,调用时直接以 /gateway开头即表示调用http://116.66.65.193:8081/gateway
59
+ // }
60
+ // }
61
+ //}
62
+ },
63
+ plugins: [
64
+ new webpack.DefinePlugin({
65
+ 'process.env': require('../config/dev.env')
66
+ }),
67
+ new webpack.HotModuleReplacementPlugin(),
68
+ new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
69
+ new webpack.NoEmitOnErrorsPlugin(),
70
+ // https://github.com/ampedandwired/html-webpack-plugin
71
+ new HtmlWebpackPlugin({
72
+ filename: 'index.html',
73
+ template: 'index.html',
74
+ inject: true
75
+ }),
76
+ // copy custom static assets
77
+ new CopyWebpackPlugin([
78
+ {
79
+ from: path.resolve(__dirname, '../static'),
80
+ to: config.dev.assetsSubDirectory,
81
+ ignore: ['.*']
82
+ }
83
+ ])
84
+ ]
85
+ })
86
+
87
+ module.exports = new Promise((resolve, reject) => {
88
+ portfinder.basePort = process.env.PORT || config.dev.port
89
+ portfinder.getPort((err, port) => {
90
+ if (err) {
91
+ reject(err)
92
+ } else {
93
+ // publish the new Port, necessary for e2e tests
94
+ process.env.PORT = port
95
+ // add port to devServer config
96
+ devWebpackConfig.devServer.port = port
97
+
98
+ // Add FriendlyErrorsPlugin
99
+ devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
100
+ compilationSuccessInfo: {
101
+ messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`],
102
+ },
103
+ onErrors: config.dev.notifyOnErrors
104
+ ? utils.createNotifierCallback()
105
+ : undefined
106
+ }))
107
+
108
+ resolve(devWebpackConfig)
109
+ }
110
+ })
111
+ })