1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-24 13:43:12 +02:00

MM-46725 Add build-product target to compile the Boards product (#4016)

This commit is contained in:
Harrison Healey 2022-10-13 16:56:59 -04:00 committed by GitHub
parent ccd09fd7b6
commit 3479e02657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 1 deletions

View File

@ -186,6 +186,10 @@ watch-plugin: modd-precheck ## Run and upload the plugin to a development server
live-watch-plugin: modd-precheck ## Run and update locally the plugin in the development server
cd mattermost-plugin; make live-watch
.PHONY: build-product
build-product: ## Builds the product as something the Mattermost server will pull files from when packaging a release
cd mattermost-plugin; make build-product
.PHONY: watch-product
watch-product: ## Run the product as something the Mattermost web app will watch for
cd mattermost-plugin; make watch-product

View File

@ -174,6 +174,10 @@ endif
deploy-from-watch: bundle
./build/bin/pluginctl deploy $(PLUGIN_ID) dist/$(BUNDLE_NAME)
.PHONY: build-product
build-product: apply
cd webapp && npm run build:product
.PHONY: watch-product
watch-product: apply
cd webapp && npm run start:product

View File

@ -12,6 +12,7 @@
"test:watch": "jest --watch",
"test-ci": "jest --forceExit --detectOpenHandles --maxWorkers=2",
"check-types": "tsc",
"build:product": "webpack --mode=production",
"start:product": "webpack serve --mode=development"
},
"devDependencies": {

View File

@ -12,7 +12,7 @@ const tsTransformer = require('@formatjs/ts-transformer');
const PLUGIN_ID = require('../plugin.json').id;
const NPM_TARGET = process.env.npm_lifecycle_event; //eslint-disable-line no-process-env
const TARGET_IS_PRODUCT = NPM_TARGET === 'start:product' || NPM_TARGET === 'build:product';
const TARGET_IS_PRODUCT = NPM_TARGET?.endsWith(':product');
let mode = 'production';
let devtool;
@ -169,6 +169,10 @@ if (TARGET_IS_PRODUCT) {
config.plugins.push(new webpack.DefinePlugin({
'process.env.TARGET_IS_PRODUCT': TARGET_IS_PRODUCT, // TODO We might want a better name for this
}));
config.output = {
path: path.join(__dirname, '/dist'),
};
} else {
config.resolve.alias['react-intl'] = path.resolve(__dirname, '../../webapp/node_modules/react-intl/');