-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
43 lines (41 loc) · 1.27 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const { defineConfig } = require('@vue/cli-service')
const path = require('path')
const serve = require('./config/server.ts')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const webpack = require('webpack')
const moduleName = process.env.TARGETMODULE || 'monitor'
const currentDate = new Date().toLocaleDateString().split('/').join('-')
const currentTime = new Date().toLocaleTimeString().split(':').join('-')
module.exports = defineConfig({
runtimeCompiler: true,
transpileDependencies: true,
css: {
loaderOptions: {
less: {
javascriptEnabled: true,
},
},
},
devServer: serve,
publicPath: '/',
outputDir: `dist/${moduleName}_${currentDate}_${currentTime}`,
configureWebpack: {
entry: `/packages/${moduleName}/src/main.ts`,
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'windows.jQuery': 'jquery',
}),
],
},
chainWebpack: (config) => {
config.resolve.alias.set('@share', path.resolve(__dirname, `packages/share`)).set('@monitor', path.resolve(__dirname, `packages/monitor/src`))
},
pluginOptions: {
electronBuilder: {
mainProcessFile: 'background.js',
outputDir: `dist-electron/${moduleName}_${currentDate}_${currentTime}`,
},
},
})