actual/packages/loot-core/webpack/webpack.mobile.config.js
2022-04-28 22:44:38 -04:00

42 lines
967 B
JavaScript

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'),
output: {
path: path.resolve(path.join(__dirname, '/../lib-dist')),
filename: 'bundle.mobile.js',
libraryTarget: 'commonjs2'
},
resolve: {
extensions: ['.mobile.js', '.electron.js', '.js', '.json'],
alias: {
'perf-deets': require.resolve('perf-deets/noop')
}
},
externals: ['better-sqlite3', 'rn-bridge'],
module: {
rules: [
{
test: /\.m?js$/,
use: {
loader: 'babel-loader',
options: {
presets: ['babel-preset-jwl-app']
}
}
}
]
},
plugins: [
new webpack.SourceMapDevToolPlugin({
filename: 'bundle.mobile.js.map',
sourceRoot: 'app://'
})
],
node: {
__dirname: false
}
};