mattermost-desktop/webpack.config.base.js
Devin Binnie 0a7be91576
[MM-42538] Submit nightly builds to TestFlight for macOS (#2023)
* Initial MAS build, working on TestFlight

* Migration of old configs to MAS

* Ignore fastlane files

* Add mac app store build to nightly build

* Revert Me - For testing in PR

* Don't need to install fastlane

* BIG D

* Fix patch updater script to allow for no yml

* Nevermind, do this instead

* Update xcode

* Let's try a fake version that works

* Revert version and rename for test flight

* Use Xcode 13.0.0

* Use CircleCI build number when available

* Revert testing changes

* Remove notarize for MAS

* Change vars to MACOS instead of IOS

* Revert electron-builder to v22

* Revert package-lock.json

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
2022-03-28 11:06:00 -04:00

48 lines
1.7 KiB
JavaScript

// Copyright (c) 2015-2016 Yuya Ochiai
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
// This file uses CommonJS.
/* eslint-disable import/no-commonjs */
'use strict';
const childProcess = require('child_process');
const webpack = require('webpack');
const path = require('path');
const VERSION = childProcess.execSync('git rev-parse --short HEAD').toString();
const isProduction = process.env.NODE_ENV === 'production';
const isRelease = process.env.CIRCLE_BRANCH && process.env.CIRCLE_BRANCH.startsWith('release-');
const codeDefinitions = {
__HASH_VERSION__: !isRelease && JSON.stringify(VERSION),
__CAN_UPGRADE__: JSON.stringify(true), // we should set this to false when working on a store version. Hardcoding for now.
__IS_NIGHTLY_BUILD__: JSON.stringify(process.env.CIRCLE_BRANCH === 'nightly'),
__IS_MAC_APP_STORE__: JSON.stringify(process.env.IS_MAC_APP_STORE === 'true'),
};
codeDefinitions['process.env.NODE_ENV'] = JSON.stringify(process.env.NODE_ENV);
module.exports = {
// Some plugins cause errors on the app, so use few plugins.
// https://webpack.js.org/concepts/mode/#mode-production
mode: isProduction ? 'none' : 'development',
plugins: [
new webpack.DefinePlugin(codeDefinitions),
],
devtool: isProduction ? false : '#inline-source-map',
resolve: {
alias: {
renderer: path.resolve(__dirname, 'src/renderer'),
main: path.resolve(__dirname, './src/main'),
common: path.resolve(__dirname, './src/common'),
static: path.resolve(__dirname, './src/assets'),
},
extensions: ['.ts', '.tsx', '.js', '.jsx', '.json'],
},
};
/* eslint-enable import/no-commonjs */