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: {
|
2021-11-04 09:33:51 +00:00
|
|
|
nodeIntegration: true,
|
|
|
|
chainWebpackRendererProcess: (config) => {
|
|
|
|
config.target('electron-renderer');
|
|
|
|
},
|
|
|
|
},
|
2021-08-18 15:36:32 +00:00
|
|
|
},
|
2019-12-12 17:37:43 +00:00
|
|
|
pages: {
|
|
|
|
index: {
|
|
|
|
entry: 'src/main.js',
|
2021-11-04 09:33:51 +00:00
|
|
|
filename: 'index.html',
|
2019-12-12 17:37:43 +00:00
|
|
|
},
|
|
|
|
print: {
|
|
|
|
entry: 'src/print.js',
|
2021-11-04 09:33:51 +00:00
|
|
|
filename: 'print.html',
|
|
|
|
},
|
2019-12-12 17:37:43 +00:00
|
|
|
},
|
|
|
|
runtimeCompiler: true,
|
|
|
|
lintOnSave: process.env.NODE_ENV !== 'production',
|
|
|
|
configureWebpack(config) {
|
|
|
|
Object.assign(config.resolve.alias, {
|
|
|
|
deepmerge$: 'deepmerge/dist/umd.js',
|
2020-01-01 08:11:57 +00:00
|
|
|
'frappe-charts$': 'frappe-charts/dist/frappe-charts.esm.js',
|
2021-11-04 09:33:51 +00:00
|
|
|
'~': path.resolve('.'),
|
2019-12-12 17:37:43 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
config.plugins.push(
|
|
|
|
// https://github.com/knex/knex/issues/1446#issuecomment-537715431
|
|
|
|
new webpack.ContextReplacementPlugin(
|
2019-12-16 11:27:28 +00:00
|
|
|
/knex[/\\]lib[/\\]dialects/,
|
|
|
|
/sqlite3[/\\]index.js/
|
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';
|
|
|
|
},
|
2021-11-04 09:33:51 +00:00
|
|
|
transpileDependencies: ['frappejs'],
|
2019-12-12 17:37:43 +00:00
|
|
|
};
|