2017-04-12 13:12:57 +03:00
|
|
|
const path = require('path')
|
|
|
|
const webpack = require('webpack')
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: 'terminus',
|
|
|
|
target: 'node',
|
|
|
|
entry: {
|
2019-05-24 22:19:08 +03:00
|
|
|
'index.ignore': 'file-loader?name=index.html!pug-html-loader!' + path.resolve(__dirname, './index.pug'),
|
2019-11-26 17:51:31 +03:00
|
|
|
sentry: path.resolve(__dirname, 'lib/sentry.ts'),
|
2018-08-31 16:41:28 +03:00
|
|
|
preload: path.resolve(__dirname, 'src/entry.preload.ts'),
|
|
|
|
bundle: path.resolve(__dirname, 'src/entry.ts'),
|
2021-05-24 18:48:12 +03:00
|
|
|
'bundle-web': path.resolve(__dirname, 'src/entry-web.ts'),
|
2017-04-12 13:12:57 +03:00
|
|
|
},
|
2019-02-10 00:10:42 +03:00
|
|
|
mode: process.env.TERMINUS_DEV ? 'development' : 'production',
|
2018-10-12 01:17:02 +03:00
|
|
|
optimization:{
|
|
|
|
minimize: false,
|
|
|
|
},
|
2017-04-12 13:12:57 +03:00
|
|
|
context: __dirname,
|
2019-06-24 14:40:37 +03:00
|
|
|
devtool: 'source-map',
|
2017-04-12 13:12:57 +03:00
|
|
|
output: {
|
2017-04-24 01:34:07 +03:00
|
|
|
path: path.join(__dirname, 'dist'),
|
2017-04-12 13:12:57 +03:00
|
|
|
pathinfo: true,
|
2018-08-31 16:41:28 +03:00
|
|
|
filename: '[name].js',
|
2017-04-12 13:12:57 +03:00
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
modules: ['src/', 'node_modules', '../node_modules', 'assets/'].map(x => path.join(__dirname, x)),
|
|
|
|
extensions: ['.ts', '.js'],
|
|
|
|
},
|
|
|
|
module: {
|
2018-05-20 17:12:05 +03:00
|
|
|
rules: [
|
2017-04-12 13:12:57 +03:00
|
|
|
{
|
|
|
|
test: /\.ts$/,
|
2018-05-20 17:12:05 +03:00
|
|
|
use: {
|
|
|
|
loader: 'awesome-typescript-loader',
|
|
|
|
options: {
|
|
|
|
configFileName: path.resolve(__dirname, 'tsconfig.json'),
|
2018-08-31 16:41:28 +03:00
|
|
|
},
|
|
|
|
},
|
2017-04-12 13:12:57 +03:00
|
|
|
},
|
2017-04-24 01:43:58 +03:00
|
|
|
{ test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
|
|
|
|
{ test: /\.css$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
|
2017-04-12 13:12:57 +03:00
|
|
|
{
|
|
|
|
test: /\.(png|svg)$/,
|
2018-05-20 17:12:05 +03:00
|
|
|
use: {
|
2021-05-24 18:48:12 +03:00
|
|
|
loader: 'url-loader',
|
2018-05-20 17:12:05 +03:00
|
|
|
options: {
|
2021-05-24 18:48:12 +03:00
|
|
|
limit: 999999,
|
2018-08-31 16:41:28 +03:00
|
|
|
},
|
|
|
|
},
|
2017-04-12 13:12:57 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
test: /\.(ttf|eot|otf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
2018-05-20 17:12:05 +03:00
|
|
|
use: {
|
|
|
|
loader: 'file-loader',
|
|
|
|
options: {
|
2018-08-31 16:41:28 +03:00
|
|
|
name: 'fonts/[name].[ext]',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2017-04-12 13:12:57 +03:00
|
|
|
},
|
|
|
|
externals: {
|
|
|
|
'@angular/core': 'commonjs @angular/core',
|
|
|
|
'@angular/compiler': 'commonjs @angular/compiler',
|
|
|
|
'@angular/platform-browser': 'commonjs @angular/platform-browser',
|
|
|
|
'@angular/platform-browser-dynamic': 'commonjs @angular/platform-browser-dynamic',
|
|
|
|
'@angular/forms': 'commonjs @angular/forms',
|
|
|
|
'@angular/common': 'commonjs @angular/common',
|
|
|
|
'@ng-bootstrap/ng-bootstrap': 'commonjs @ng-bootstrap/ng-bootstrap',
|
2021-05-24 18:48:12 +03:00
|
|
|
'@electron/remote': 'commonjs @electron/remote',
|
2018-08-31 16:41:28 +03:00
|
|
|
child_process: 'commonjs child_process',
|
|
|
|
electron: 'commonjs electron',
|
|
|
|
fs: 'commonjs fs',
|
2018-01-19 17:31:28 +03:00
|
|
|
'ngx-toastr': 'commonjs ngx-toastr',
|
2018-08-31 16:41:28 +03:00
|
|
|
module: 'commonjs module',
|
|
|
|
mz: 'commonjs mz',
|
|
|
|
path: 'commonjs path',
|
|
|
|
rxjs: 'commonjs rxjs',
|
2017-07-01 01:55:21 +03:00
|
|
|
'zone.js': 'commonjs zone.js/dist/zone.js',
|
2017-06-21 00:28:58 +03:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.optimize.ModuleConcatenationPlugin(),
|
2019-11-26 17:51:31 +03:00
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.type': '"renderer"'
|
|
|
|
}),
|
2017-06-21 00:28:58 +03:00
|
|
|
],
|
2017-04-12 13:12:57 +03:00
|
|
|
}
|