mattermost-desktop/webpack.config.main.js
Devin Binnie 0cab09b7f5
[MM-55152] Add new Desktop API endpoints, improve preload script, some clean-up (#2900)
* Add constants for app info, add to API

* Migrate history button

* Converted calls API over to context bridge, removed some unnecessary logging

* Convert to TS, add types for web app to consume

* Fix tests, prune

* Fix lint

* More changes to support the legacy API

* Force legacy code off, add support for unreads/mentions/expired through the API

* Fix issues with cross-tab login, removed need for log in/log out signalling

* Fixed test, typos

* Change package name for types

* Add some other stuff to the types

* PR feedback

* More feedback

* Use npm package

* Change types and API to provide off listeners

* Version number

* Lock

* Fix typo

* Add sessionID for calls
2023-12-13 09:39:46 -05:00

59 lines
1.5 KiB
JavaScript

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// Copyright (c) 2015-2016 Yuya Ochiai
// This files uses CommonJS.
/* eslint-disable import/no-commonjs */
'use strict';
const {merge} = require('webpack-merge');
const CopyPlugin = require('copy-webpack-plugin');
const base = require('./webpack.config.base');
module.exports = merge(base, {
entry: {
index: './src/main/app/index.ts',
internalAPI: './src/main/preload/internalAPI.js',
externalAPI: './src/main/preload/externalAPI.ts',
},
externals: {
'macos-notification-state': 'require("macos-notification-state")',
'windows-focus-assist': 'require("windows-focus-assist")',
},
module: {
rules: [{
test: /\.(js|ts)?$/,
use: {
loader: 'babel-loader',
options: {
include: ['@babel/plugin-proposal-class-properties'],
},
},
}, {
test: /\.mp3$/,
type: 'asset/inline',
},
{
test: /\.node$/,
loader: 'node-loader',
}],
},
plugins: [
new CopyPlugin({
patterns: [{
from: 'assets/**/*',
context: 'src',
}],
}),
],
node: {
__filename: true,
__dirname: true,
},
target: 'electron-main',
});
/* eslint-enable import/no-commonjs */