Skip to content

Commit 24a4643

Browse files
committed
Merge branch 'v9'
2 parents bbcaae5 + 028bc7f commit 24a4643

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+4798
-3312
lines changed

.electron-vue/dev-runner.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ function startRenderer () {
5555

5656
const app = express()
5757
const multiCompiler = webpack(Configs)
58-
const instance = webpackDevMiddleware(multiCompiler, {
59-
hot: true
60-
})
58+
const instance = webpackDevMiddleware(multiCompiler)
6159
hotMiddleware = webpackHotMiddleware(multiCompiler, {
6260
log: false,
6361
heartbeat: 2500

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

+13-5
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,19 @@ let mainConfig = {
8484
manifest: require('../static/vendor-manifest.json')
8585
}),
8686
new ForkTsCheckerWebpackPlugin({
87-
checkSyntacticErrors: true,
88-
eslint: true,
89-
tsconfig: path.join(__dirname, '../src/tsconfig.json'),
90-
tslintAutoFix: false,
91-
vue: true
87+
eslint: {
88+
files: './src/**/*.{js,ts,vue}'
89+
},
90+
typescript: {
91+
configFile: path.join(__dirname, '../src/tsconfig.json'),
92+
diagnosticOptions: {
93+
semantic: true,
94+
syntactic: true
95+
},
96+
extensions: {
97+
vue: true
98+
}
99+
}
92100
}),
93101
new ForkTsCheckerNotifierWebpackPlugin({ title: 'Main Process', excludeWarnings: false })
94102
],

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

+83-36
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,21 @@ const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin')
1616
const VueLoaderPlugin = require('vue-loader/lib/plugin')
1717
const CopyWebpackPlugin = require('copy-webpack-plugin')
1818

19+
function inlineOptions(loaders) {
20+
return loaders.map(({ loader, options={} }) => {
21+
if (!isString(loader)) throw new Error('inlineOptions: loader should be a string!')
22+
if (!isObjectLike(options)) throw new Error('inlineOptions: options should be an object!')
23+
return loader + '?' + JSON.stringify(options)
24+
})
25+
}
26+
1927
function returnLess() {
2028
return [
2129
process.env.NODE_ENV !== 'production'
2230
? 'vue-style-loader'
2331
: MiniCssExtractPlugin.loader,
24-
'css-loader',
32+
// https://blog.csdn.net/vv_bug/article/details/108148263
33+
'css-loader?{"esModule":false}',
2534
'less-loader'
2635
]
2736
}
@@ -30,7 +39,8 @@ function returnCss() {
3039
process.env.NODE_ENV !== 'production'
3140
? 'vue-style-loader'
3241
: MiniCssExtractPlugin.loader,
33-
'css-loader'
42+
// https://blog.csdn.net/vv_bug/article/details/108148263
43+
'css-loader?{"esModule":false}'
3444
]
3545
}
3646

@@ -45,7 +55,7 @@ let whiteListedModules = ['vue']
4555

4656
let mainBrowserWindowConfig = {
4757
name: 'main-browser-window',
48-
devtool: '#cheap-module-eval-source-map',
58+
devtool: 'cheap-module-source-map',
4959
entry: {
5060
'main-browser-window': path.join(__dirname, '../src/renderer/mainBrowserWindow/main.ts')
5161
},
@@ -211,11 +221,19 @@ let mainBrowserWindowConfig = {
211221
manifest: require('../static/vendor-manifest.json')
212222
}),
213223
new ForkTsCheckerWebpackPlugin({
214-
checkSyntacticErrors: true,
215-
eslint: true,
216-
tsconfig: path.join(__dirname, '../src/tsconfig.json'),
217-
tslintAutoFix: false,
218-
vue: true
224+
eslint: {
225+
files: './src/**/*.{js,ts,vue}'
226+
},
227+
typescript: {
228+
configFile: path.join(__dirname, '../src/tsconfig.json'),
229+
diagnosticOptions: {
230+
semantic: true,
231+
syntactic: true
232+
},
233+
extensions: {
234+
vue: true
235+
}
236+
}
219237
}),
220238
new ForkTsCheckerNotifierWebpackPlugin({ title: 'Renderer Process [mainBrowserWindow]', excludeWarnings: false }),
221239
new VueLoaderPlugin(),
@@ -248,7 +266,7 @@ let mainBrowserWindowConfig = {
248266

249267
let preloadsConfig = {
250268
name: 'preloads',
251-
devtool: '#cheap-module-eval-source-map',
269+
devtool: 'cheap-module-source-map',
252270
entry: {
253271
'webview-preload': path.join(__dirname, '../src/preloads/webview-preload.ts'),
254272
'extension-preload': path.join(__dirname, '../src/preloads/extension-preload.ts'),
@@ -303,11 +321,19 @@ let preloadsConfig = {
303321
test: /-preload\.js$/
304322
}),
305323
new ForkTsCheckerWebpackPlugin({
306-
checkSyntacticErrors: true,
307-
eslint: true,
308-
tsconfig: path.join(__dirname, '../src/tsconfig.json'),
309-
tslintAutoFix: false,
310-
vue: true
324+
eslint: {
325+
files: './src/**/*.{js,ts,vue}'
326+
},
327+
typescript: {
328+
configFile: path.join(__dirname, '../src/tsconfig.json'),
329+
diagnosticOptions: {
330+
semantic: true,
331+
syntactic: true
332+
},
333+
extensions: {
334+
vue: true
335+
}
336+
}
311337
}),
312338
new ForkTsCheckerNotifierWebpackPlugin({ title: 'Renderer Process [preloads]', excludeWarnings: false })
313339
],
@@ -330,7 +356,7 @@ let preloadsConfig = {
330356

331357
let preferenceViewConfig = {
332358
name: 'preference-view',
333-
devtool: '#cheap-module-eval-source-map',
359+
devtool: 'cheap-module-source-map',
334360
entry: {
335361
'preference-view': path.join(__dirname, '../src/renderer/preferenceView/main.ts')
336362
},
@@ -474,10 +500,19 @@ let preferenceViewConfig = {
474500
manifest: require('../static/vendor-manifest.json')
475501
}),
476502
new ForkTsCheckerWebpackPlugin({
477-
checkSyntacticErrors: true,
478-
eslint: true,
479-
tsconfig: path.join(__dirname, '../src/tsconfig.json'),
480-
vue: true
503+
eslint: {
504+
files: './src/**/*.{js,ts,vue}'
505+
},
506+
typescript: {
507+
configFile: path.join(__dirname, '../src/tsconfig.json'),
508+
diagnosticOptions: {
509+
semantic: true,
510+
syntactic: true
511+
},
512+
extensions: {
513+
vue: true
514+
}
515+
}
481516
}),
482517
new ForkTsCheckerNotifierWebpackPlugin({ title: 'Renderer Process [preferenceView]', excludeWarnings: false }),
483518
new VueLoaderPlugin()
@@ -502,7 +537,7 @@ let preferenceViewConfig = {
502537

503538
let playbooksViewConfig = {
504539
name: 'playbooks-view',
505-
devtool: '#cheap-module-eval-source-map',
540+
devtool: 'cheap-module-source-map',
506541
entry: {
507542
'playbooks-view': path.join(__dirname, '../src/renderer/playbooksView/main.ts')
508543
},
@@ -647,10 +682,19 @@ let playbooksViewConfig = {
647682
manifest: require('../static/vendor-manifest.json')
648683
}),
649684
new ForkTsCheckerWebpackPlugin({
650-
checkSyntacticErrors: true,
651-
eslint: true,
652-
tsconfig: path.join(__dirname, '../src/tsconfig.json'),
653-
vue: true
685+
eslint: {
686+
files: './src/**/*.{js,ts,vue}'
687+
},
688+
typescript: {
689+
configFile: path.join(__dirname, '../src/tsconfig.json'),
690+
diagnosticOptions: {
691+
semantic: true,
692+
syntactic: true
693+
},
694+
extensions: {
695+
vue: true
696+
}
697+
}
654698
}),
655699
new ForkTsCheckerNotifierWebpackPlugin({ title: 'Renderer Process [playbooksView]', excludeWarnings: false }),
656700
new VueLoaderPlugin()
@@ -675,7 +719,7 @@ let playbooksViewConfig = {
675719

676720
let commandPaletteConfig = {
677721
name: 'command-palette',
678-
devtool: '#cheap-module-eval-source-map',
722+
devtool: 'cheap-module-source-map',
679723
entry: {
680724
'command-palette': path.join(__dirname, '../src/renderer/commandPalette/main.ts')
681725
},
@@ -822,10 +866,19 @@ let commandPaletteConfig = {
822866
manifest: require('../static/vendor-manifest.json')
823867
}),
824868
new ForkTsCheckerWebpackPlugin({
825-
checkSyntacticErrors: true,
826-
eslint: true,
827-
tsconfig: path.join(__dirname, '../src/tsconfig.json'),
828-
vue: true
869+
eslint: {
870+
files: './src/**/*.{js,ts,vue}'
871+
},
872+
typescript: {
873+
configFile: path.join(__dirname, '../src/tsconfig.json'),
874+
diagnosticOptions: {
875+
semantic: true,
876+
syntactic: true
877+
},
878+
extensions: {
879+
vue: true
880+
}
881+
}
829882
}),
830883
new ForkTsCheckerNotifierWebpackPlugin({ title: 'Renderer Process [commandPalette]', excludeWarnings: false }),
831884
new VueLoaderPlugin()
@@ -851,7 +904,7 @@ let commandPaletteConfig = {
851904

852905
let workerConfig = {
853906
name: 'worker',
854-
devtool: '#cheap-module-eval-source-map',
907+
devtool: 'cheap-module-source-map',
855908
entry: {
856909
'search-worker': path.join(__dirname, '../src/renderer/mainBrowserWindow/js/search-worker.js'),
857910
'recommender': path.join(__dirname, '../src/renderer/commandPalette/js/recommender.js'),
@@ -894,12 +947,6 @@ if (process.env.NODE_ENV === 'production') {
894947
preferenceViewConfig.performance = { hints: false }
895948
// Because the target is 'web'. Ref: https://github.com/webpack/webpack/issues/6715
896949
playbooksViewConfig.performance = { hints: false }
897-
mainBrowserWindowConfig.devtool = false
898-
preloadsConfig.devtool = false
899-
preferenceViewConfig.devtool = false
900-
playbooksViewConfig.devtool = false
901-
commandPaletteConfig.devtool = false
902-
workerConfig.devtool = false
903950

904951
mainBrowserWindowConfig.plugins.push(
905952
new webpack.LoaderOptionsPlugin({

.eslintrc.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@
8888
{ "args": "after-used" }
8989
],
9090
"import/newline-after-import": "off",
91-
"no-control-regex": "off"
91+
"no-control-regex": "off",
92+
"@typescript-eslint/explicit-module-boundary-types": "off",
93+
"@typescript-eslint/member-delimiter-style": "error"
9294
},
9395
"settings": {
9496
"import/resolver": {

0 commit comments

Comments
 (0)