2020-01-01 08:11:57 +00:00
|
|
|
const path = require('path');
|
2019-12-12 17:37:43 +00:00
|
|
|
const webpack = require('webpack');
|
|
|
|
|
|
|
|
module.exports = {
|
2021-08-18 15:36:32 +00:00
|
|
|
pluginOptions: {
|
|
|
|
electronBuilder: {
|
2022-05-26 19:15:05 +00:00
|
|
|
externals: ['knex', 'better-sqlite3'],
|
2021-11-04 09:33:51 +00:00
|
|
|
nodeIntegration: true,
|
2022-03-16 09:49:48 +00:00
|
|
|
mainProcessFile: 'main.ts',
|
2022-03-16 06:42:00 +00:00
|
|
|
disableMainProcessTypescript: false,
|
|
|
|
mainProcessTypeChecking: true,
|
2021-11-04 09:33:51 +00:00
|
|
|
chainWebpackRendererProcess: (config) => {
|
|
|
|
config.target('electron-renderer');
|
2022-04-19 05:59:36 +00:00
|
|
|
config.resolve.alias.set('fyo', path.resolve(__dirname, './fyo'));
|
2022-04-21 13:08:36 +00:00
|
|
|
config.resolve.alias.set('utils', path.resolve(__dirname, './utils'));
|
2022-01-21 09:38:53 +00:00
|
|
|
},
|
|
|
|
chainWebpackMainProcess: (config) => {
|
|
|
|
config.target('electron-main');
|
2022-04-19 05:59:36 +00:00
|
|
|
config.resolve.alias.set('fyo', path.resolve(__dirname, './fyo'));
|
2022-04-21 13:08:36 +00:00
|
|
|
config.resolve.alias.set('utils', path.resolve(__dirname, './utils'));
|
2022-01-21 09:38:53 +00:00
|
|
|
config.module
|
|
|
|
.rule('js')
|
|
|
|
.test(/\.js$/)
|
|
|
|
.use('babel')
|
|
|
|
.loader('babel-loader');
|
2021-11-04 09:33:51 +00:00
|
|
|
},
|
|
|
|
},
|
2021-08-18 15:36:32 +00:00
|
|
|
},
|
2019-12-12 17:37:43 +00:00
|
|
|
pages: {
|
|
|
|
index: {
|
2022-04-20 10:41:27 +00:00
|
|
|
entry: 'src/renderer.ts',
|
2021-11-04 09:33:51 +00:00
|
|
|
filename: 'index.html',
|
2019-12-12 17:37:43 +00:00
|
|
|
},
|
|
|
|
},
|
2022-05-26 19:15:05 +00:00
|
|
|
parallel: false,
|
2019-12-12 17:37:43 +00:00
|
|
|
runtimeCompiler: true,
|
|
|
|
lintOnSave: process.env.NODE_ENV !== 'production',
|
|
|
|
configureWebpack(config) {
|
|
|
|
Object.assign(config.resolve.alias, {
|
2022-04-19 05:59:36 +00:00
|
|
|
fyo: path.resolve(__dirname, './fyo'),
|
2022-04-20 06:38:47 +00:00
|
|
|
src: path.resolve(__dirname, './src'),
|
2022-03-28 10:01:29 +00:00
|
|
|
schemas: path.resolve(__dirname, './schemas'),
|
|
|
|
backend: path.resolve(__dirname, './backend'),
|
2022-04-21 13:08:36 +00:00
|
|
|
models: path.resolve(__dirname, './models'),
|
2022-03-29 08:18:39 +00:00
|
|
|
utils: path.resolve(__dirname, './utils'),
|
2022-04-11 12:44:36 +00:00
|
|
|
regional: path.resolve(__dirname, './regional'),
|
2022-04-21 13:08:36 +00:00
|
|
|
reports: path.resolve(__dirname, './reports'),
|
2022-05-10 09:26:17 +00:00
|
|
|
dummy: path.resolve(__dirname, './dummy'),
|
2022-04-20 06:38:47 +00:00
|
|
|
fixtures: path.resolve(__dirname, './fixtures'),
|
2019-12-12 17:37:43 +00:00
|
|
|
});
|
|
|
|
|
2020-01-28 11:10:01 +00:00
|
|
|
config.module.rules.push({
|
|
|
|
test: /\.txt$/i,
|
2021-11-04 09:33:51 +00:00
|
|
|
use: 'raw-loader',
|
2020-01-28 11:10:01 +00:00
|
|
|
});
|
|
|
|
|
2019-12-12 17:37:43 +00:00
|
|
|
config.devtool = 'source-map';
|
|
|
|
},
|
|
|
|
};
|