tabby/app/webpack.main.config.js

59 lines
1.6 KiB
JavaScript
Raw Normal View History

const path = require('path')
const webpack = require('webpack')
module.exports = {
name: 'terminus-main',
target: 'node',
entry: {
main: path.resolve(__dirname, 'lib/index.ts'),
},
2019-02-09 21:10:42 +00:00
mode: process.env.TERMINUS_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: {
loader: 'awesome-typescript-loader',
options: {
configFileName: path.resolve(__dirname, 'tsconfig.main.json'),
},
},
},
],
},
externals: {
electron: 'commonjs electron',
'electron-config': 'commonjs electron-config',
2021-01-01 17:25:54 +00:00
'electron-promise-ipc': 'commonjs electron-promise-ipc',
'electron-vibrancy': 'commonjs electron-vibrancy',
fs: 'commonjs fs',
glasstron: 'commonjs glasstron',
mz: 'commonjs mz',
2021-01-01 17:25:54 +00:00
npm: 'commonjs npm',
path: 'commonjs path',
2021-01-01 17:25:54 +00:00
util: 'commonjs util',
'source-map-support': 'commonjs source-map-support',
'windows-swca': 'commonjs windows-swca',
2019-05-06 12:09:30 +00:00
'windows-blurbehind': 'commonjs windows-blurbehind',
},
plugins: [
new webpack.optimize.ModuleConcatenationPlugin(),
2019-11-26 14:51:31 +00:00
new webpack.DefinePlugin({
'process.type': '"main"',
}),
],
2021-01-02 19:24:26 +00:00
// Ignore warnings due to yarg's dynamic module loading
ignoreWarnings: [/node_modules\/yargs/],
}