actual/packages/loot-core/webpack/webpack.desktop.config.js

52 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2022-04-29 02:44:38 +00:00
let path = require('path');
let webpack = require('webpack');
module.exports = {
mode: process.env.NODE_ENV === 'development' ? 'development' : 'production',
target: 'node',
entry: path.join(__dirname, '../src/server/main.js'),
context: path.resolve(__dirname, '../../..'),
devtool: 'source-map',
output: {
path: path.resolve(path.join(__dirname, '/../lib-dist')),
filename: 'bundle.desktop.js',
sourceMapFilename: 'bundle.desktop.js.map',
libraryTarget: 'commonjs2'
},
resolve: {
extensions: ['.electron.js', '.js', '.json'],
alias: {
'perf-deets': require.resolve('perf-deets/noop')
}
},
externals: [
'better-sqlite3',
'node-ipc',
'electron-log',
'node-fetch',
'node-libofx'
],
module: {
rules: [
{
test: /\.m?js$/,
use: {
loader: 'babel-loader',
options: {
presets: ['babel-preset-jwl-app']
}
}
}
]
},
plugins: [
new webpack.IgnorePlugin({
resourceRegExp: /original-fs/
})
],
node: {
__dirname: false,
__filename: false
}
};