1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-12-21 01:21:52 +03:00
tabby/app/webpack.main.config.js

68 lines
2.2 KiB
JavaScript
Raw Normal View History

const path = require('path')
const webpack = require('webpack')
2021-04-08 23:26:47 +03:00
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
module.exports = {
2021-06-30 19:32:18 +03:00
name: 'tabby-main',
target: 'electron-main',
entry: {
main: path.resolve(__dirname, 'lib/index.ts'),
},
mode: process.env.TABBY_DEV ? 'development' : 'production',
context: __dirname,
devtool: 'source-map',
output: {
path: path.join(__dirname, 'dist'),
pathinfo: true,
filename: '[name].js',
},
resolve: {
modules: ['lib/', 'node_modules', '../node_modules'].map(x => path.join(__dirname, x)),
extensions: ['.ts', '.js'],
},
module: {
rules: [
{
test: /\.ts$/,
use: {
2021-07-06 10:40:54 +03:00
loader: 'ts-loader',
2021-06-30 19:32:18 +03:00
options: {
2021-07-06 10:40:54 +03:00
configFile: path.resolve(__dirname, 'tsconfig.main.json'),
2021-06-30 19:32:18 +03:00
},
},
},
],
},
externals: {
2021-07-27 10:59:35 +03:00
'v8-compile-cache': 'commonjs v8-compile-cache',
2021-06-30 19:32:18 +03:00
'any-promise': 'commonjs any-promise',
electron: 'commonjs electron',
'electron-config': 'commonjs electron-config',
'electron-debug': 'commonjs electron-debug',
'electron-promise-ipc': 'commonjs electron-promise-ipc',
fs: 'commonjs fs',
glasstron: 'commonjs glasstron',
mz: 'commonjs mz',
npm: 'commonjs npm',
2021-08-16 01:02:24 +03:00
'node:os': 'commonjs os',
2021-08-19 00:31:00 +03:00
'@tabby-gang/node-pty': 'commonjs @tabby-gang/node-pty',
2021-06-30 19:32:18 +03:00
path: 'commonjs path',
util: 'commonjs util',
'source-map-support': 'commonjs source-map-support',
'windows-swca': 'commonjs windows-swca',
'windows-native-registry': 'commonjs windows-native-registry',
2021-12-12 15:14:24 +03:00
'@tabby-gang/windows-blurbehind': 'commonjs @tabby-gang/windows-blurbehind',
2021-06-30 19:32:18 +03:00
'yargs/yargs': 'commonjs yargs/yargs',
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.DefinePlugin({
'process.type': '"main"',
}),
],
2021-04-08 23:26:47 +03:00
}
if (process.env.BUNDLE_ANALYZER) {
module.exports.plugins.push(new BundleAnalyzerPlugin())
}