openatc-components 0.0.1 → 0.0.2

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 (154) hide show
  1. package/.babelrc +18 -18
  2. package/.editorconfig +9 -9
  3. package/.eslintignore +5 -5
  4. package/.eslintrc.js +29 -29
  5. package/.postcssrc.js +10 -10
  6. package/README.md +30 -30
  7. package/build/build.js +41 -41
  8. package/build/check-versions.js +54 -54
  9. package/build/package.config.js +58 -58
  10. package/build/package.dev.config.js +25 -25
  11. package/build/package.prod.config.js +60 -60
  12. package/build/utils.js +101 -101
  13. package/build/vue-loader.conf.js +22 -22
  14. package/build/webpack.base.conf.js +109 -109
  15. package/build/webpack.dev.conf.js +95 -95
  16. package/build/webpack.prod.conf.js +149 -149
  17. package/config/dev.env.js +7 -7
  18. package/config/index.js +76 -76
  19. package/config/prod.env.js +4 -4
  20. package/config/test.env.js +7 -7
  21. package/index.html +12 -12
  22. package/package/kisscomps/components/CircleMenu/KissCircleMenu.vue +398 -398
  23. package/package/kisscomps/components/CircleMenu/index.js +2 -2
  24. package/package/kisscomps/components/DashBoard/MakeGradientColor.js +84 -84
  25. package/package/kisscomps/components/DashBoard/dashboard.js +471 -471
  26. package/package/kisscomps/components/DashBoard/dashboard.vue +57 -57
  27. package/package/kisscomps/components/DashBoard/index.js +2 -2
  28. package/package/kisscomps/components/Horizontal/KissHorizontal.vue +146 -146
  29. package/package/kisscomps/components/Horizontal/index.js +2 -2
  30. package/package/kisscomps/components/HorizontalChildren/KissHorizontalChildren.vue +196 -196
  31. package/package/kisscomps/components/HorizontalChildren/index.js +2 -2
  32. package/package/kisscomps/components/KissCircleMenu/CircleMenu.vue +113 -113
  33. package/package/kisscomps/components/KissCircleMenu/index.js +2 -2
  34. package/package/kisscomps/components/KissCircleMenu/style/index.less +1 -1
  35. package/package/kisscomps/components/KissCircleMenu/style/main/core.less +161 -161
  36. package/package/kisscomps/components/KissCircleMenu/style/main/other.less +94 -94
  37. package/package/kisscomps/components/KissCircleMenu/style/mixin/mixin.less +36 -36
  38. package/package/kisscomps/components/KissCircleMenu/style/var/var.less +21 -21
  39. package/package/kisscomps/components/KissCircleMenu/utils/colorRE.js +5 -5
  40. package/package/kisscomps/components/KissMessageBox/KissMessageBox.vue +108 -108
  41. package/package/kisscomps/components/KissMessageBox/index.js +2 -2
  42. package/package/kisscomps/components/KissSearchInput/index.js +2 -2
  43. package/package/kisscomps/components/KissSearchInput/kisssearchinput.vue +77 -77
  44. package/package/kisscomps/components/KissSimulationProgress/KissSimulationProgress.vue +294 -294
  45. package/package/kisscomps/components/KissSimulationProgress/index.js +2 -2
  46. package/package/kisscomps/components/StatusBar/StatusBar.vue +222 -222
  47. package/package/kisscomps/components/StatusBar/index.js +2 -2
  48. package/package/kisscomps/components/TragResize/index.js +2 -2
  49. package/package/kisscomps/components/TragResize/kissdragresize.vue +536 -536
  50. package/package/kisscomps/components/TragResize/util/dom.js +23 -23
  51. package/package/kisscomps/components/TragResize/util/fns.js +3 -3
  52. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.1.vue +320 -320
  53. package/package/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +345 -345
  54. package/package/kisscomps/components/XRDDirSelector/index.js +2 -2
  55. package/package/kisscomps/components/button/index.js +2 -2
  56. package/package/kisscomps/components/button/kissbutton.vue +168 -168
  57. package/package/kisscomps/components/compass3D/compass.vue +180 -180
  58. package/package/kisscomps/components/compass3D/index.js +2 -2
  59. package/package/kisscomps/components/header/index.js +2 -2
  60. package/package/kisscomps/components/header/kissHead.vue +83 -83
  61. package/package/kisscomps/components/horizontalMenu/index.js +2 -2
  62. package/package/kisscomps/components/horizontalMenu/kissHorizontalMenu.vue +254 -254
  63. package/package/kisscomps/components/input/index.js +2 -2
  64. package/package/kisscomps/components/input/kissinput.vue +57 -57
  65. package/package/kisscomps/components/menu/index.js +2 -2
  66. package/package/kisscomps/components/menu/kissmenu.vue +324 -324
  67. package/package/kisscomps/components/mutipletips/Tdrag.js +585 -585
  68. package/package/kisscomps/components/mutipletips/index.js +2 -2
  69. package/package/kisscomps/components/mutipletips/kissmutipletips.vue +192 -192
  70. package/package/kisscomps/components/panel/index.js +2 -2
  71. package/package/kisscomps/components/panel/kissPanel.vue +151 -151
  72. package/package/kisscomps/components/select/chosen.jquery.min.js +3 -3
  73. package/package/kisscomps/components/select/index.js +2 -2
  74. package/package/kisscomps/components/select/kissselect.vue +527 -527
  75. package/package/kisscomps/components/tablebutton/index.js +2 -2
  76. package/package/kisscomps/components/tablebutton/tablebutton.vue +97 -97
  77. package/package/kisscomps/components/timectrl/KissTimeCtrl.vue +67 -67
  78. package/package/kisscomps/components/timectrl/index.js +2 -2
  79. package/package/kisscomps/components/timectrl/timectrl.css +851 -851
  80. package/package/kisscomps/components/tip/Tdrag.js +585 -585
  81. package/package/kisscomps/components/tip/index.js +2 -2
  82. package/package/kisscomps/components/tip/kisstips.1.vue +154 -154
  83. package/package/kisscomps/components/tip/kisstips.vue +154 -154
  84. package/package/kisscomps/components/tip/kisstips.vue.bak +211 -211
  85. package/package/kisscomps/index.js +71 -71
  86. package/package/kissui.js +203 -203
  87. package/package/kissui.min.js +203 -203
  88. package/package.json +1 -1
  89. package/src/App.vue +25 -25
  90. package/src/kisscomps/components/CircleMenu/KissCircleMenu.vue +398 -398
  91. package/src/kisscomps/components/CircleMenu/index.js +2 -2
  92. package/src/kisscomps/components/DashBoard/MakeGradientColor.js +84 -84
  93. package/src/kisscomps/components/DashBoard/dashboard.js +471 -471
  94. package/src/kisscomps/components/DashBoard/dashboard.vue +57 -57
  95. package/src/kisscomps/components/DashBoard/index.js +2 -2
  96. package/src/kisscomps/components/KissCircleMenu/CircleMenu.vue +113 -113
  97. package/src/kisscomps/components/KissCircleMenu/index.js +2 -2
  98. package/src/kisscomps/components/KissCircleMenu/style/index.less +1 -1
  99. package/src/kisscomps/components/KissCircleMenu/style/main/core.less +161 -161
  100. package/src/kisscomps/components/KissCircleMenu/style/main/other.less +94 -94
  101. package/src/kisscomps/components/KissCircleMenu/style/mixin/mixin.less +36 -36
  102. package/src/kisscomps/components/KissCircleMenu/style/var/var.less +21 -21
  103. package/src/kisscomps/components/KissCircleMenu/utils/colorRE.js +5 -5
  104. package/src/kisscomps/components/KissSearchInput/index.js +2 -2
  105. package/src/kisscomps/components/KissSearchInput/kisssearchinput.vue +77 -77
  106. package/src/kisscomps/components/SchemeConfig/closePhaselControlModal/index.vue +193 -0
  107. package/src/kisscomps/components/SchemeConfig/index.js +2 -0
  108. package/src/kisscomps/components/SchemeConfig/lockingPhaselControlModal/index.vue +214 -0
  109. package/src/kisscomps/components/SchemeConfig/manualControlModal/index.vue +176 -0
  110. package/src/kisscomps/components/SchemeConfig/realtimeStatusModal/index.vue +294 -0
  111. package/src/kisscomps/components/SchemeConfig/schemeconfig.vue +711 -0
  112. package/src/kisscomps/components/StatusBar/StatusBar.vue +222 -222
  113. package/src/kisscomps/components/StatusBar/index.js +2 -2
  114. package/src/kisscomps/components/TragResize/index.js +2 -2
  115. package/src/kisscomps/components/TragResize/kissdragresize.vue +536 -536
  116. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.1.vue +320 -320
  117. package/src/kisscomps/components/XRDDirSelector/XRDDirSelector.vue +345 -345
  118. package/src/kisscomps/components/XRDDirSelector/index.js +2 -2
  119. package/src/kisscomps/components/button/index.js +2 -2
  120. package/src/kisscomps/components/button/kissbutton.vue +168 -168
  121. package/src/kisscomps/components/compass3D/compass.vue +180 -180
  122. package/src/kisscomps/components/compass3D/index.js +2 -2
  123. package/src/kisscomps/components/horizontalMenu/index.js +2 -2
  124. package/src/kisscomps/components/horizontalMenu/kissHorizontalMenu.vue +254 -254
  125. package/src/kisscomps/components/input/index.js +2 -2
  126. package/src/kisscomps/components/input/kissinput.vue +57 -57
  127. package/src/kisscomps/components/menu/index.js +2 -2
  128. package/src/kisscomps/components/menu/kissmenu.vue +324 -324
  129. package/src/kisscomps/components/mutipletips/Tdrag.js +585 -585
  130. package/src/kisscomps/components/mutipletips/index.js +2 -2
  131. package/src/kisscomps/components/mutipletips/kissmutipletips.vue +192 -192
  132. package/src/kisscomps/components/select/chosen.jquery.min.js +3 -3
  133. package/src/kisscomps/components/select/index.js +2 -2
  134. package/src/kisscomps/components/select/kissselect.vue +527 -527
  135. package/src/kisscomps/components/timectrl/KissTimeCtrl.vue +67 -67
  136. package/src/kisscomps/components/timectrl/index.js +2 -2
  137. package/src/kisscomps/components/tip/Tdrag.js +585 -585
  138. package/src/kisscomps/components/tip/index.js +2 -2
  139. package/src/kisscomps/components/tip/kisstips.1.vue +154 -154
  140. package/src/kisscomps/components/tip/kisstips.vue +154 -154
  141. package/src/kisscomps/components/tip/kisstips.vue.bak +211 -211
  142. package/src/kisscomps/index.js +73 -71
  143. package/src/main.js +23 -23
  144. package/src/router/index.js +15 -15
  145. package/src/views/home.1.vue +479 -479
  146. package/src/views/home.vue +196 -196
  147. package/test/e2e/custom-assertions/elementCount.js +27 -27
  148. package/test/e2e/nightwatch.conf.js +46 -46
  149. package/test/e2e/runner.js +48 -48
  150. package/test/e2e/specs/test.js +19 -19
  151. package/test/unit/.eslintrc +7 -7
  152. package/test/unit/jest.conf.js +30 -30
  153. package/test/unit/setup.js +3 -3
  154. package/test/unit/specs/HelloWorld.spec.js +11 -11
@@ -1,95 +1,95 @@
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
- },
47
- plugins: [
48
- new webpack.DefinePlugin({
49
- 'process.env': require('../config/dev.env')
50
- }),
51
- new webpack.HotModuleReplacementPlugin(),
52
- new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
53
- new webpack.NoEmitOnErrorsPlugin(),
54
- // https://github.com/ampedandwired/html-webpack-plugin
55
- new HtmlWebpackPlugin({
56
- filename: 'index.html',
57
- template: 'index.html',
58
- inject: true
59
- }),
60
- // copy custom static assets
61
- new CopyWebpackPlugin([
62
- {
63
- from: path.resolve(__dirname, '../static'),
64
- to: config.dev.assetsSubDirectory,
65
- ignore: ['.*']
66
- }
67
- ])
68
- ]
69
- })
70
-
71
- module.exports = new Promise((resolve, reject) => {
72
- portfinder.basePort = process.env.PORT || config.dev.port
73
- portfinder.getPort((err, port) => {
74
- if (err) {
75
- reject(err)
76
- } else {
77
- // publish the new Port, necessary for e2e tests
78
- process.env.PORT = port
79
- // add port to devServer config
80
- devWebpackConfig.devServer.port = port
81
-
82
- // Add FriendlyErrorsPlugin
83
- devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
84
- compilationSuccessInfo: {
85
- messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`]
86
- },
87
- onErrors: config.dev.notifyOnErrors
88
- ? utils.createNotifierCallback()
89
- : undefined
90
- }))
91
-
92
- resolve(devWebpackConfig)
93
- }
94
- })
95
- })
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
+ },
47
+ plugins: [
48
+ new webpack.DefinePlugin({
49
+ 'process.env': require('../config/dev.env')
50
+ }),
51
+ new webpack.HotModuleReplacementPlugin(),
52
+ new webpack.NamedModulesPlugin(), // HMR shows correct file names in console on update.
53
+ new webpack.NoEmitOnErrorsPlugin(),
54
+ // https://github.com/ampedandwired/html-webpack-plugin
55
+ new HtmlWebpackPlugin({
56
+ filename: 'index.html',
57
+ template: 'index.html',
58
+ inject: true
59
+ }),
60
+ // copy custom static assets
61
+ new CopyWebpackPlugin([
62
+ {
63
+ from: path.resolve(__dirname, '../static'),
64
+ to: config.dev.assetsSubDirectory,
65
+ ignore: ['.*']
66
+ }
67
+ ])
68
+ ]
69
+ })
70
+
71
+ module.exports = new Promise((resolve, reject) => {
72
+ portfinder.basePort = process.env.PORT || config.dev.port
73
+ portfinder.getPort((err, port) => {
74
+ if (err) {
75
+ reject(err)
76
+ } else {
77
+ // publish the new Port, necessary for e2e tests
78
+ process.env.PORT = port
79
+ // add port to devServer config
80
+ devWebpackConfig.devServer.port = port
81
+
82
+ // Add FriendlyErrorsPlugin
83
+ devWebpackConfig.plugins.push(new FriendlyErrorsPlugin({
84
+ compilationSuccessInfo: {
85
+ messages: [`Your application is running here: http://${devWebpackConfig.devServer.host}:${port}`]
86
+ },
87
+ onErrors: config.dev.notifyOnErrors
88
+ ? utils.createNotifierCallback()
89
+ : undefined
90
+ }))
91
+
92
+ resolve(devWebpackConfig)
93
+ }
94
+ })
95
+ })
@@ -1,149 +1,149 @@
1
- 'use strict'
2
- const path = require('path')
3
- const utils = require('./utils')
4
- const webpack = require('webpack')
5
- const config = require('../config')
6
- const merge = require('webpack-merge')
7
- const baseWebpackConfig = require('./webpack.base.conf')
8
- const CopyWebpackPlugin = require('copy-webpack-plugin')
9
- const HtmlWebpackPlugin = require('html-webpack-plugin')
10
- const ExtractTextPlugin = require('extract-text-webpack-plugin')
11
- const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
12
- const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
13
-
14
- const env = process.env.NODE_ENV === 'testing'
15
- ? require('../config/test.env')
16
- : require('../config/prod.env')
17
-
18
- const webpackConfig = merge(baseWebpackConfig, {
19
- module: {
20
- rules: utils.styleLoaders({
21
- sourceMap: config.build.productionSourceMap,
22
- extract: true,
23
- usePostCSS: true
24
- })
25
- },
26
- devtool: config.build.productionSourceMap ? config.build.devtool : false,
27
- output: {
28
- path: config.build.assetsRoot,
29
- filename: utils.assetsPath('js/[name].[chunkhash].js'),
30
- chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
31
- },
32
- plugins: [
33
- // http://vuejs.github.io/vue-loader/en/workflow/production.html
34
- new webpack.DefinePlugin({
35
- 'process.env': env
36
- }),
37
- new UglifyJsPlugin({
38
- uglifyOptions: {
39
- compress: {
40
- warnings: false
41
- }
42
- },
43
- sourceMap: config.build.productionSourceMap,
44
- parallel: true
45
- }),
46
- // extract css into its own file
47
- new ExtractTextPlugin({
48
- filename: utils.assetsPath('css/[name].[contenthash].css'),
49
- // Setting the following option to `false` will not extract CSS from codesplit chunks.
50
- // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
51
- // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
52
- // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
53
- allChunks: true
54
- }),
55
- // Compress extracted CSS. We are using this plugin so that possible
56
- // duplicated CSS from different components can be deduped.
57
- new OptimizeCSSPlugin({
58
- cssProcessorOptions: config.build.productionSourceMap
59
- ? { safe: true, map: { inline: false } }
60
- : { safe: true }
61
- }),
62
- // generate dist index.html with correct asset hash for caching.
63
- // you can customize output by editing /index.html
64
- // see https://github.com/ampedandwired/html-webpack-plugin
65
- new HtmlWebpackPlugin({
66
- filename: process.env.NODE_ENV === 'testing'
67
- ? 'index.html'
68
- : config.build.index,
69
- template: 'index.html',
70
- inject: true,
71
- minify: {
72
- removeComments: true,
73
- collapseWhitespace: true,
74
- removeAttributeQuotes: true
75
- // more options:
76
- // https://github.com/kangax/html-minifier#options-quick-reference
77
- },
78
- // necessary to consistently work with multiple chunks via CommonsChunkPlugin
79
- chunksSortMode: 'dependency'
80
- }),
81
- // keep module.id stable when vendor modules does not change
82
- new webpack.HashedModuleIdsPlugin(),
83
- // enable scope hoisting
84
- new webpack.optimize.ModuleConcatenationPlugin(),
85
- // split vendor js into its own file
86
- new webpack.optimize.CommonsChunkPlugin({
87
- name: 'vendor',
88
- minChunks (module) {
89
- // any required modules inside node_modules are extracted to vendor
90
- return (
91
- module.resource &&
92
- /\.js$/.test(module.resource) &&
93
- module.resource.indexOf(
94
- path.join(__dirname, '../node_modules')
95
- ) === 0
96
- )
97
- }
98
- }),
99
- // extract webpack runtime and module manifest to its own file in order to
100
- // prevent vendor hash from being updated whenever app bundle is updated
101
- new webpack.optimize.CommonsChunkPlugin({
102
- name: 'manifest',
103
- minChunks: Infinity
104
- }),
105
- // This instance extracts shared chunks from code splitted chunks and bundles them
106
- // in a separate chunk, similar to the vendor chunk
107
- // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
108
- new webpack.optimize.CommonsChunkPlugin({
109
- name: 'app',
110
- async: 'vendor-async',
111
- children: true,
112
- minChunks: 3
113
- }),
114
-
115
- // copy custom static assets
116
- new CopyWebpackPlugin([
117
- {
118
- from: path.resolve(__dirname, '../static'),
119
- to: config.build.assetsSubDirectory,
120
- ignore: ['.*']
121
- }
122
- ])
123
- ]
124
- })
125
-
126
- if (config.build.productionGzip) {
127
- const CompressionWebpackPlugin = require('compression-webpack-plugin')
128
-
129
- webpackConfig.plugins.push(
130
- new CompressionWebpackPlugin({
131
- asset: '[path].gz[query]',
132
- algorithm: 'gzip',
133
- test: new RegExp(
134
- '\\.(' +
135
- config.build.productionGzipExtensions.join('|') +
136
- ')$'
137
- ),
138
- threshold: 10240,
139
- minRatio: 0.8
140
- })
141
- )
142
- }
143
-
144
- if (config.build.bundleAnalyzerReport) {
145
- const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
146
- webpackConfig.plugins.push(new BundleAnalyzerPlugin())
147
- }
148
-
149
- module.exports = webpackConfig
1
+ 'use strict'
2
+ const path = require('path')
3
+ const utils = require('./utils')
4
+ const webpack = require('webpack')
5
+ const config = require('../config')
6
+ const merge = require('webpack-merge')
7
+ const baseWebpackConfig = require('./webpack.base.conf')
8
+ const CopyWebpackPlugin = require('copy-webpack-plugin')
9
+ const HtmlWebpackPlugin = require('html-webpack-plugin')
10
+ const ExtractTextPlugin = require('extract-text-webpack-plugin')
11
+ const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
12
+ const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
13
+
14
+ const env = process.env.NODE_ENV === 'testing'
15
+ ? require('../config/test.env')
16
+ : require('../config/prod.env')
17
+
18
+ const webpackConfig = merge(baseWebpackConfig, {
19
+ module: {
20
+ rules: utils.styleLoaders({
21
+ sourceMap: config.build.productionSourceMap,
22
+ extract: true,
23
+ usePostCSS: true
24
+ })
25
+ },
26
+ devtool: config.build.productionSourceMap ? config.build.devtool : false,
27
+ output: {
28
+ path: config.build.assetsRoot,
29
+ filename: utils.assetsPath('js/[name].[chunkhash].js'),
30
+ chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
31
+ },
32
+ plugins: [
33
+ // http://vuejs.github.io/vue-loader/en/workflow/production.html
34
+ new webpack.DefinePlugin({
35
+ 'process.env': env
36
+ }),
37
+ new UglifyJsPlugin({
38
+ uglifyOptions: {
39
+ compress: {
40
+ warnings: false
41
+ }
42
+ },
43
+ sourceMap: config.build.productionSourceMap,
44
+ parallel: true
45
+ }),
46
+ // extract css into its own file
47
+ new ExtractTextPlugin({
48
+ filename: utils.assetsPath('css/[name].[contenthash].css'),
49
+ // Setting the following option to `false` will not extract CSS from codesplit chunks.
50
+ // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
51
+ // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
52
+ // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
53
+ allChunks: true
54
+ }),
55
+ // Compress extracted CSS. We are using this plugin so that possible
56
+ // duplicated CSS from different components can be deduped.
57
+ new OptimizeCSSPlugin({
58
+ cssProcessorOptions: config.build.productionSourceMap
59
+ ? { safe: true, map: { inline: false } }
60
+ : { safe: true }
61
+ }),
62
+ // generate dist index.html with correct asset hash for caching.
63
+ // you can customize output by editing /index.html
64
+ // see https://github.com/ampedandwired/html-webpack-plugin
65
+ new HtmlWebpackPlugin({
66
+ filename: process.env.NODE_ENV === 'testing'
67
+ ? 'index.html'
68
+ : config.build.index,
69
+ template: 'index.html',
70
+ inject: true,
71
+ minify: {
72
+ removeComments: true,
73
+ collapseWhitespace: true,
74
+ removeAttributeQuotes: true
75
+ // more options:
76
+ // https://github.com/kangax/html-minifier#options-quick-reference
77
+ },
78
+ // necessary to consistently work with multiple chunks via CommonsChunkPlugin
79
+ chunksSortMode: 'dependency'
80
+ }),
81
+ // keep module.id stable when vendor modules does not change
82
+ new webpack.HashedModuleIdsPlugin(),
83
+ // enable scope hoisting
84
+ new webpack.optimize.ModuleConcatenationPlugin(),
85
+ // split vendor js into its own file
86
+ new webpack.optimize.CommonsChunkPlugin({
87
+ name: 'vendor',
88
+ minChunks (module) {
89
+ // any required modules inside node_modules are extracted to vendor
90
+ return (
91
+ module.resource &&
92
+ /\.js$/.test(module.resource) &&
93
+ module.resource.indexOf(
94
+ path.join(__dirname, '../node_modules')
95
+ ) === 0
96
+ )
97
+ }
98
+ }),
99
+ // extract webpack runtime and module manifest to its own file in order to
100
+ // prevent vendor hash from being updated whenever app bundle is updated
101
+ new webpack.optimize.CommonsChunkPlugin({
102
+ name: 'manifest',
103
+ minChunks: Infinity
104
+ }),
105
+ // This instance extracts shared chunks from code splitted chunks and bundles them
106
+ // in a separate chunk, similar to the vendor chunk
107
+ // see: https://webpack.js.org/plugins/commons-chunk-plugin/#extra-async-commons-chunk
108
+ new webpack.optimize.CommonsChunkPlugin({
109
+ name: 'app',
110
+ async: 'vendor-async',
111
+ children: true,
112
+ minChunks: 3
113
+ }),
114
+
115
+ // copy custom static assets
116
+ new CopyWebpackPlugin([
117
+ {
118
+ from: path.resolve(__dirname, '../static'),
119
+ to: config.build.assetsSubDirectory,
120
+ ignore: ['.*']
121
+ }
122
+ ])
123
+ ]
124
+ })
125
+
126
+ if (config.build.productionGzip) {
127
+ const CompressionWebpackPlugin = require('compression-webpack-plugin')
128
+
129
+ webpackConfig.plugins.push(
130
+ new CompressionWebpackPlugin({
131
+ asset: '[path].gz[query]',
132
+ algorithm: 'gzip',
133
+ test: new RegExp(
134
+ '\\.(' +
135
+ config.build.productionGzipExtensions.join('|') +
136
+ ')$'
137
+ ),
138
+ threshold: 10240,
139
+ minRatio: 0.8
140
+ })
141
+ )
142
+ }
143
+
144
+ if (config.build.bundleAnalyzerReport) {
145
+ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
146
+ webpackConfig.plugins.push(new BundleAnalyzerPlugin())
147
+ }
148
+
149
+ module.exports = webpackConfig
package/config/dev.env.js CHANGED
@@ -1,7 +1,7 @@
1
- 'use strict'
2
- const merge = require('webpack-merge')
3
- const prodEnv = require('./prod.env')
4
-
5
- module.exports = merge(prodEnv, {
6
- NODE_ENV: '"development"'
7
- })
1
+ 'use strict'
2
+ const merge = require('webpack-merge')
3
+ const prodEnv = require('./prod.env')
4
+
5
+ module.exports = merge(prodEnv, {
6
+ NODE_ENV: '"development"'
7
+ })
package/config/index.js CHANGED
@@ -1,76 +1,76 @@
1
- 'use strict'
2
- // Template version: 1.3.1
3
- // see http://vuejs-templates.github.io/webpack for documentation.
4
-
5
- const path = require('path')
6
-
7
- module.exports = {
8
- dev: {
9
-
10
- // Paths
11
- assetsSubDirectory: 'static',
12
- assetsPublicPath: '/',
13
- proxyTable: {},
14
-
15
- // Various Dev Server settings
16
- host: 'localhost', // can be overwritten by process.env.HOST
17
- port: 8099, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
18
- autoOpenBrowser: false,
19
- errorOverlay: true,
20
- notifyOnErrors: true,
21
- poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
22
-
23
- // Use Eslint Loader?
24
- // If true, your code will be linted during bundling and
25
- // linting errors and warnings will be shown in the console.
26
- useEslint: true,
27
- // If true, eslint errors and warnings will also be shown in the error overlay
28
- // in the browser.
29
- showEslintErrorsInOverlay: false,
30
-
31
- /**
32
- * Source Maps
33
- */
34
-
35
- // https://webpack.js.org/configuration/devtool/#development
36
- devtool: 'cheap-module-eval-source-map',
37
-
38
- // If you have problems debugging vue-files in devtools,
39
- // set this to false - it *may* help
40
- // https://vue-loader.vuejs.org/en/options.html#cachebusting
41
- cacheBusting: true,
42
-
43
- cssSourceMap: true
44
- },
45
-
46
- build: {
47
- // Template for index.html
48
- index: path.resolve(__dirname, '../dist/index.html'),
49
-
50
- // Paths
51
- assetsRoot: path.resolve(__dirname, '../dist'),
52
- assetsSubDirectory: 'static',
53
- assetsPublicPath: './',
54
-
55
- /**
56
- * Source Maps
57
- */
58
-
59
- productionSourceMap: true,
60
- // https://webpack.js.org/configuration/devtool/#production
61
- devtool: '#source-map',
62
-
63
- // Gzip off by default as many popular static hosts such as
64
- // Surge or Netlify already gzip all static assets for you.
65
- // Before setting to `true`, make sure to:
66
- // npm install --save-dev compression-webpack-plugin
67
- productionGzip: false,
68
- productionGzipExtensions: ['js', 'css'],
69
-
70
- // Run the build command with an extra argument to
71
- // View the bundle analyzer report after build finishes:
72
- // `npm run build --report`
73
- // Set to `true` or `false` to always turn it on or off
74
- bundleAnalyzerReport: process.env.npm_config_report
75
- }
76
- }
1
+ 'use strict'
2
+ // Template version: 1.3.1
3
+ // see http://vuejs-templates.github.io/webpack for documentation.
4
+
5
+ const path = require('path')
6
+
7
+ module.exports = {
8
+ dev: {
9
+
10
+ // Paths
11
+ assetsSubDirectory: 'static',
12
+ assetsPublicPath: '/',
13
+ proxyTable: {},
14
+
15
+ // Various Dev Server settings
16
+ host: 'localhost', // can be overwritten by process.env.HOST
17
+ port: 8099, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
18
+ autoOpenBrowser: false,
19
+ errorOverlay: true,
20
+ notifyOnErrors: true,
21
+ poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
22
+
23
+ // Use Eslint Loader?
24
+ // If true, your code will be linted during bundling and
25
+ // linting errors and warnings will be shown in the console.
26
+ useEslint: true,
27
+ // If true, eslint errors and warnings will also be shown in the error overlay
28
+ // in the browser.
29
+ showEslintErrorsInOverlay: false,
30
+
31
+ /**
32
+ * Source Maps
33
+ */
34
+
35
+ // https://webpack.js.org/configuration/devtool/#development
36
+ devtool: 'cheap-module-eval-source-map',
37
+
38
+ // If you have problems debugging vue-files in devtools,
39
+ // set this to false - it *may* help
40
+ // https://vue-loader.vuejs.org/en/options.html#cachebusting
41
+ cacheBusting: true,
42
+
43
+ cssSourceMap: true
44
+ },
45
+
46
+ build: {
47
+ // Template for index.html
48
+ index: path.resolve(__dirname, '../dist/index.html'),
49
+
50
+ // Paths
51
+ assetsRoot: path.resolve(__dirname, '../dist'),
52
+ assetsSubDirectory: 'static',
53
+ assetsPublicPath: './',
54
+
55
+ /**
56
+ * Source Maps
57
+ */
58
+
59
+ productionSourceMap: true,
60
+ // https://webpack.js.org/configuration/devtool/#production
61
+ devtool: '#source-map',
62
+
63
+ // Gzip off by default as many popular static hosts such as
64
+ // Surge or Netlify already gzip all static assets for you.
65
+ // Before setting to `true`, make sure to:
66
+ // npm install --save-dev compression-webpack-plugin
67
+ productionGzip: false,
68
+ productionGzipExtensions: ['js', 'css'],
69
+
70
+ // Run the build command with an extra argument to
71
+ // View the bundle analyzer report after build finishes:
72
+ // `npm run build --report`
73
+ // Set to `true` or `false` to always turn it on or off
74
+ bundleAnalyzerReport: process.env.npm_config_report
75
+ }
76
+ }
@@ -1,4 +1,4 @@
1
- 'use strict'
2
- module.exports = {
3
- NODE_ENV: '"production"'
4
- }
1
+ 'use strict'
2
+ module.exports = {
3
+ NODE_ENV: '"production"'
4
+ }