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