2018-08-26 18:35:04 +03:00
|
|
|
const path = require('path')
|
|
|
|
const webpack = require('webpack')
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: 'terminus-main',
|
|
|
|
target: 'node',
|
|
|
|
entry: {
|
2018-08-31 16:41:28 +03:00
|
|
|
main: path.resolve(__dirname, 'lib/index.ts'),
|
2018-08-26 18:35:04 +03:00
|
|
|
},
|
2019-02-10 00:10:42 +03:00
|
|
|
mode: process.env.TERMINUS_DEV ? 'development' : 'production',
|
2018-08-26 18:35:04 +03:00
|
|
|
context: __dirname,
|
2019-04-28 12:42:34 +03:00
|
|
|
devtool: 'eval-source-map',
|
2018-08-26 18:35:04 +03: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 16:41:28 +03:00
|
|
|
test: /\.ts$/,
|
2018-08-26 18:35:04 +03:00
|
|
|
use: {
|
2018-08-31 16:41:28 +03:00
|
|
|
loader: 'awesome-typescript-loader',
|
2018-08-26 18:35:04 +03:00
|
|
|
options: {
|
2018-08-31 16:41:28 +03:00
|
|
|
configFileName: path.resolve(__dirname, 'tsconfig.main.json'),
|
2018-08-26 18:35:04 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
externals: {
|
|
|
|
electron: 'commonjs electron',
|
|
|
|
'electron-config': 'commonjs electron-config',
|
|
|
|
'electron-vibrancy': 'commonjs electron-vibrancy',
|
|
|
|
fs: 'commonjs fs',
|
|
|
|
mz: 'commonjs mz',
|
|
|
|
path: 'commonjs path',
|
|
|
|
yargs: 'commonjs yargs',
|
2018-10-05 21:12:06 +03:00
|
|
|
'windows-swca': 'commonjs windows-swca',
|
2019-05-06 15:09:30 +03:00
|
|
|
'windows-blurbehind': 'commonjs windows-blurbehind',
|
2018-08-26 18:35:04 +03:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.optimize.ModuleConcatenationPlugin(),
|
|
|
|
],
|
|
|
|
}
|