forked from frappe/books
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
59 lines (56 loc) · 1.83 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
const path = require('path');
const webpack = require('webpack');
module.exports = {
pluginOptions: {
electronBuilder: {
externals: ['knex', 'better-sqlite3'],
nodeIntegration: true,
mainProcessFile: 'main.ts',
disableMainProcessTypescript: false,
mainProcessTypeChecking: true,
chainWebpackRendererProcess: (config) => {
config.target('electron-renderer');
config.resolve.alias.set('fyo', path.resolve(__dirname, './fyo'));
config.resolve.alias.set('utils', path.resolve(__dirname, './utils'));
},
chainWebpackMainProcess: (config) => {
config.target('electron-main');
config.resolve.alias.set('fyo', path.resolve(__dirname, './fyo'));
config.resolve.alias.set('utils', path.resolve(__dirname, './utils'));
config.module
.rule('js')
.test(/\.js$/)
.use('babel')
.loader('babel-loader');
},
},
},
pages: {
index: {
entry: 'src/renderer.ts',
filename: 'index.html',
},
},
parallel: false,
runtimeCompiler: true,
lintOnSave: process.env.NODE_ENV !== 'production',
configureWebpack(config) {
Object.assign(config.resolve.alias, {
fyo: path.resolve(__dirname, './fyo'),
src: path.resolve(__dirname, './src'),
schemas: path.resolve(__dirname, './schemas'),
backend: path.resolve(__dirname, './backend'),
models: path.resolve(__dirname, './models'),
utils: path.resolve(__dirname, './utils'),
regional: path.resolve(__dirname, './regional'),
reports: path.resolve(__dirname, './reports'),
dummy: path.resolve(__dirname, './dummy'),
fixtures: path.resolve(__dirname, './fixtures'),
});
config.module.rules.push({
test: /\.txt$/i,
use: 'raw-loader',
});
config.devtool = 'source-map';
},
};