2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 19:39:07 +00:00
books/vue.config.js

59 lines
1.5 KiB
JavaScript
Raw Normal View History

const path = require('path');
const webpack = require('webpack');
module.exports = {
pluginOptions: {
electronBuilder: {
nodeIntegration: true,
2022-01-24 07:19:27 +00:00
disableMainProcessTypescript: true,
mainProcessTypeChecking: false,
chainWebpackRendererProcess: (config) => {
config.target('electron-renderer');
config.resolve.alias.set('frappe', path.resolve(__dirname, './frappe'));
},
chainWebpackMainProcess: (config) => {
config.target('electron-main');
config.resolve.alias.set('frappe', path.resolve(__dirname, './frappe'));
config.module
.rule('js')
.test(/\.js$/)
.use('babel')
.loader('babel-loader');
},
},
},
pages: {
index: {
entry: 'src/main.js',
filename: 'index.html',
},
print: {
entry: 'src/print.js',
filename: 'print.html',
},
},
runtimeCompiler: true,
lintOnSave: process.env.NODE_ENV !== 'production',
configureWebpack(config) {
Object.assign(config.resolve.alias, {
frappe: path.resolve(__dirname, './frappe'),
'~': path.resolve('.'),
});
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/
)
);
2020-01-28 11:10:01 +00:00
config.module.rules.push({
test: /\.txt$/i,
use: 'raw-loader',
2020-01-28 11:10:01 +00:00
});
config.devtool = 'source-map';
},
};