2017-04-12 13:12:57 +03:00
|
|
|
const path = require('path')
|
|
|
|
const webpack = require('webpack')
|
|
|
|
|
|
|
|
module.exports = {
|
2021-06-30 00:57:04 +03:00
|
|
|
name: 'tabby',
|
2021-06-16 00:43:02 +03:00
|
|
|
target: 'node',
|
|
|
|
entry: {
|
|
|
|
'index.ignore': 'file-loader?name=index.html!pug-html-loader!' + path.resolve(__dirname, './index.pug'),
|
|
|
|
sentry: path.resolve(__dirname, 'lib/sentry.ts'),
|
|
|
|
preload: path.resolve(__dirname, 'src/entry.preload.ts'),
|
|
|
|
bundle: path.resolve(__dirname, 'src/entry.ts'),
|
|
|
|
},
|
2021-06-30 00:57:04 +03:00
|
|
|
mode: process.env.TABBY_DEV ? 'development' : 'production',
|
2021-06-16 00:43:02 +03:00
|
|
|
optimization:{
|
|
|
|
minimize: false,
|
|
|
|
},
|
|
|
|
context: __dirname,
|
|
|
|
devtool: 'source-map',
|
|
|
|
output: {
|
|
|
|
path: path.join(__dirname, 'dist'),
|
|
|
|
pathinfo: true,
|
|
|
|
filename: '[name].js',
|
|
|
|
publicPath: 'auto',
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
modules: ['src/', 'node_modules', '../node_modules', 'assets/'].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-16 00:43:02 +03:00
|
|
|
options: {
|
2021-07-06 10:40:54 +03:00
|
|
|
configFile: path.resolve(__dirname, 'tsconfig.json'),
|
2021-06-16 00:43:02 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{ test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
|
|
|
|
{ test: /\.css$/, use: ['style-loader', 'css-loader', 'sass-loader'] },
|
|
|
|
{
|
2021-07-31 20:28:01 +03:00
|
|
|
test: /\.(png|svg|ttf|eot|otf|woff|woff2)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
|
|
|
|
type: 'asset',
|
2021-06-16 00:43:02 +03:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
externals: {
|
|
|
|
'@electron/remote': 'commonjs @electron/remote',
|
2021-07-27 10:59:35 +03:00
|
|
|
'v8-compile-cache': 'commonjs v8-compile-cache',
|
2021-06-16 00:43:02 +03:00
|
|
|
child_process: 'commonjs child_process',
|
|
|
|
electron: 'commonjs electron',
|
|
|
|
fs: 'commonjs fs',
|
|
|
|
module: 'commonjs module',
|
|
|
|
mz: 'commonjs mz',
|
|
|
|
path: 'commonjs path',
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new webpack.optimize.ModuleConcatenationPlugin(),
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.type': '"renderer"',
|
|
|
|
}),
|
2018-08-31 16:41:28 +03:00
|
|
|
],
|
2017-04-12 13:12:57 +03:00
|
|
|
}
|