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

43 lines
967 B
JavaScript
Raw 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'),
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
}
};