Skip to content

Commit 010832c

Browse files
committed
build: upgrading all modules
1 parent bedb2d0 commit 010832c

File tree

11 files changed

+278
-250
lines changed

11 files changed

+278
-250
lines changed

CHANGELOG.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,4 @@ All notable changes to this project will be documented in this file. See [standa
44

55
### [1.1.1](https://github.com/kdydesign/vue-electron/compare/v1.0.1...v1.1.1) (2020-01-15)
66

7-
8-
### Bug Fixes
9-
10-
* test ([92e7929](https://github.com/kdydesign/vue-electron/commit/92e7929cda6e408e1fb7ab5dc4b71d0bfcb9119f))
11-
127
### [1.0.1](https://github.com/kdydesign/vue-electron/compare/v1.1.0...v1.0.1) (2020-01-15)

meta.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,10 @@ module.exports = {
166166
deps (plugins) {
167167
let output = ''
168168
const dependencies = {
169-
axios: '^0.19.0',
169+
axios: '^0.19.2',
170170
'vue-electron': '^1.0.6',
171-
'vue-router': '^3.1.3',
172-
vuex: '^3.1.2',
171+
'vue-router': '^3.2.0',
172+
vuex: '^3.4.0',
173173
'vuex-electron': '^1.0.3'
174174
}
175175

@@ -187,10 +187,10 @@ module.exports = {
187187

188188
switch (framework) {
189189
case 'vuetify':
190-
output = ', \n "vuetify": "^2.1.15"'
190+
output = ', \n "vuetify": "^2.2.29"'
191191
break
192192
case 'quasar':
193-
output = ', \n "quasar": "^1.5.11"'
193+
output = ', \n "quasar": "^1.11.3"'
194194
break
195195
}
196196

template/.electron-vue/dev-runner.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const { spawn } = require('child_process')
88
const webpack = require('webpack')
99
const WebpackDevServer = require('webpack-dev-server')
1010
const webpackHotMiddleware = require('webpack-hot-middleware')
11+
const HtmlWebpackPlugin = require('html-webpack-plugin')
1112

1213
const mainConfig = require('./webpack.main.config')
1314
const rendererConfig = require('./webpack.renderer.config')
@@ -49,7 +50,7 @@ function startRenderer () {
4950
})
5051

5152
compiler.hooks.compilation.tap('compilation', compilation => {
52-
compilation.hooks.htmlWebpackPluginAfterEmit.tapAsync('html-webpack-plugin-after-emit', (data, cb) => {
53+
HtmlWebpackPlugin.getHooks(compilation).beforeEmit.tapAsync('html-webpack-plugin-after-emit', (data, cb) => {
5354
hotMiddleware.publish({ action: 'reload' })
5455
cb()
5556
})
@@ -127,7 +128,7 @@ function startElectron () {
127128
}
128129

129130
electronProcess = spawn(electron, args)
130-
131+
131132
electronProcess.stdout.on('data', data => {
132133
electronLog(data, 'blue')
133134
})

template/.electron-vue/webpack.main.config.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const path = require('path')
66
const { dependencies } = require('../package.json')
77
const webpack = require('webpack')
88

9-
const BabiliWebpackPlugin = require('babili-webpack-plugin')
9+
const TerserPlugin = require('terser-webpack-plugin')
1010

1111
let mainConfig = {
1212
entry: {
@@ -50,9 +50,9 @@ let mainConfig = {
5050
libraryTarget: 'commonjs2',
5151
path: path.join(__dirname, '../dist/electron')
5252
},
53-
plugins: [
54-
new webpack.NoEmitOnErrorsPlugin()
55-
],
53+
optimization: {
54+
noEmitOnErrors: true // NoEmitOnErrorsPlugin
55+
},
5656
resolve: {
5757
extensions: ['.js', '.json', '.node']
5858
},
@@ -63,6 +63,10 @@ let mainConfig = {
6363
* Adjust mainConfig for development settings
6464
*/
6565
if (process.env.NODE_ENV !== 'production') {
66+
if (mainConfig.plugins === void 0) {
67+
mainConfig.plugins = []
68+
}
69+
6670
mainConfig.plugins.push(
6771
new webpack.DefinePlugin({
6872
'__static': `"${path.join(__dirname, '../static').replace(/\\/g, '\\\\')}"`
@@ -74,8 +78,16 @@ if (process.env.NODE_ENV !== 'production') {
7478
* Adjust mainConfig for production settings
7579
*/
7680
if (process.env.NODE_ENV === 'production') {
81+
if (mainConfig.plugins === void 0) {
82+
mainConfig.plugins = []
83+
}
84+
85+
mainConfig.optimization = Object.assign(mainConfig.optimization, {
86+
minimize: true,
87+
minimizer: [new TerserPlugin()]
88+
})
89+
7790
mainConfig.plugins.push(
78-
new BabiliWebpackPlugin(),
7991
new webpack.DefinePlugin({
8092
'process.env.NODE_ENV': '"production"'
8193
})

template/.electron-vue/webpack.renderer.config.js

Lines changed: 100 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const path = require('path')
66
const { dependencies } = require('../package.json')
77
const webpack = require('webpack')
88

9-
const BabiliWebpackPlugin = require('babili-webpack-plugin')
9+
const TerserPlugin = require('terser-webpack-plugin')
1010
const CopyWebpackPlugin = require('copy-webpack-plugin')
1111
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
1212
const HtmlWebpackPlugin = require('html-webpack-plugin')
@@ -32,100 +32,100 @@ let rendererConfig = {
3232
module: {
3333
rules: [
3434
{{#if eslint}}
35-
{
36-
test: /\.(js|vue)$/,
37-
enforce: 'pre',
38-
exclude: /node_modules/,
39-
use: {
40-
loader: 'eslint-loader',
41-
options: {
42-
formatter: require('eslint-friendly-formatter')
43-
}
35+
{
36+
test: /\.(js|vue)$/,
37+
enforce: 'pre',
38+
exclude: /node_modules/,
39+
use: {
40+
loader: 'eslint-loader',
41+
options: {
42+
formatter: require('eslint-friendly-formatter')
4443
}
45-
},
44+
}
45+
},
4646
{{/if}}
4747
{{#if_eq csspreprocessor 'sass'}}
48-
{
49-
test: /\.scss$/,
50-
use: ['vue-style-loader', 'css-loader', 'sass-loader']
51-
},
52-
{
53-
test: /\.sass$/,
54-
use: ['vue-style-loader', 'css-loader', 'sass-loader?indentedSyntax']
55-
},
48+
{
49+
test: /\.scss$/,
50+
use: ['vue-style-loader', 'css-loader', 'sass-loader']
51+
},
52+
{
53+
test: /\.sass$/,
54+
use: ['vue-style-loader', 'css-loader', 'sass-loader?indentedSyntax']
55+
},
5656
{{/if_eq}}
5757
{{#if_eq csspreprocessor 'less'}}
58-
{
59-
test: /\.less$/,
60-
use: ['vue-style-loader', 'css-loader', 'less-loader']
61-
},
58+
{
59+
test: /\.less$/,
60+
use: ['vue-style-loader', 'css-loader', 'less-loader']
61+
},
6262
{{/if_eq}}
6363
{{#if_eq csspreprocessor 'stylus'}}
64-
{
65-
test: /\.styl$/,
66-
use: ['vue-style-loader', 'css-loader', 'stylus-loader']
67-
},
64+
{
65+
test: /\.styl$/,
66+
use: ['vue-style-loader', 'css-loader', 'stylus-loader']
67+
},
6868
{{/if_eq}}
69-
{
70-
test: /\.css$/,
71-
use: ['vue-style-loader', 'css-loader']
72-
},
73-
{
74-
test: /\.html$/,
75-
use: 'vue-html-loader'
76-
},
77-
{
78-
test: /\.js$/,
79-
use: 'babel-loader',
80-
exclude: /node_modules/
81-
},
82-
{
83-
test: /\.node$/,
84-
use: 'node-loader'
85-
},
86-
{
87-
test: /\.vue$/,
88-
use: {
89-
loader: 'vue-loader',
90-
options: {
91-
extractCSS: process.env.NODE_ENV === 'production',
92-
loaders: {
93-
sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',
94-
scss: 'vue-style-loader!css-loader!sass-loader',
95-
less: 'vue-style-loader!css-loader!less-loader',
96-
styl: 'vue-style-loader!css-loader!stylus-loader'
97-
}
98-
}
99-
}
100-
},
101-
{
102-
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
103-
use: {
104-
loader: 'url-loader',
105-
query: {
106-
limit: 10000,
107-
name: 'imgs/[name]--[folder].[ext]'
69+
{
70+
test: /\.css$/,
71+
use: ['vue-style-loader', 'css-loader']
72+
},
73+
{
74+
test: /\.html$/,
75+
use: 'vue-html-loader'
76+
},
77+
{
78+
test: /\.js$/,
79+
use: 'babel-loader',
80+
exclude: /node_modules/
81+
},
82+
{
83+
test: /\.node$/,
84+
use: 'node-loader'
85+
},
86+
{
87+
test: /\.vue$/,
88+
use: {
89+
loader: 'vue-loader',
90+
options: {
91+
extractCSS: process.env.NODE_ENV === 'production',
92+
loaders: {
93+
sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax=1',
94+
scss: 'vue-style-loader!css-loader!sass-loader',
95+
less: 'vue-style-loader!css-loader!less-loader',
96+
styl: 'vue-style-loader!css-loader!stylus-loader'
10897
}
10998
}
110-
},
111-
{
112-
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
99+
}
100+
},
101+
{
102+
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
103+
use: {
113104
loader: 'url-loader',
114-
options: {
105+
query: {
115106
limit: 10000,
116-
name: 'media/[name]--[folder].[ext]'
107+
name: 'imgs/[name]--[folder].[ext]'
117108
}
118-
},
119-
{
120-
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
121-
use: {
122-
loader: 'url-loader',
123-
query: {
124-
limit: 10000,
125-
name: 'fonts/[name]--[folder].[ext]'
126-
}
109+
}
110+
},
111+
{
112+
test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
113+
loader: 'url-loader',
114+
options: {
115+
limit: 10000,
116+
name: 'media/[name]--[folder].[ext]'
117+
}
118+
},
119+
{
120+
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
121+
use: {
122+
loader: 'url-loader',
123+
query: {
124+
limit: 10000,
125+
name: 'fonts/[name]--[folder].[ext]'
127126
}
128127
}
128+
}
129129
]
130130
},
131131
node: {
@@ -147,9 +147,11 @@ let rendererConfig = {
147147
? path.resolve(__dirname, '../node_modules')
148148
: false
149149
}),
150-
new webpack.HotModuleReplacementPlugin(),
151-
new webpack.NoEmitOnErrorsPlugin()
150+
new webpack.HotModuleReplacementPlugin()
152151
],
152+
optimization: {
153+
noEmitOnErrors: true // NoEmitOnErrorsPlugin
154+
},
153155
output: {
154156
filename: '[name].js',
155157
libraryTarget: 'commonjs2',
@@ -182,15 +184,23 @@ if (process.env.NODE_ENV !== 'production') {
182184
if (process.env.NODE_ENV === 'production') {
183185
rendererConfig.devtool = ''
184186

187+
rendererConfig.optimization = Object.assign(rendererConfig.optimization, {
188+
minimize: true,
189+
minimizer: [new TerserPlugin()]
190+
})
191+
185192
rendererConfig.plugins.push(
186-
new BabiliWebpackPlugin(),
187-
new CopyWebpackPlugin([
188-
{
189-
from: path.join(__dirname, '../static'),
190-
to: path.join(__dirname, '../dist/electron/static'),
191-
ignore: ['.*']
192-
}
193-
]),
193+
new CopyWebpackPlugin({
194+
patterns: [
195+
{
196+
from: path.join(__dirname, '../static'),
197+
to: path.join(__dirname, '../dist/electron/static'),
198+
globOptions: {
199+
ignore: ['.*']
200+
}
201+
}
202+
]
203+
}),
194204
new webpack.DefinePlugin({
195205
'process.env.NODE_ENV': '"production"'
196206
}),

0 commit comments

Comments
 (0)