From 4369f09b648ea0b1c8dab5a90840731eaa2ab4f3 Mon Sep 17 00:00:00 2001 From: Kevin Monisit Date: Sat, 27 Jan 2024 10:16:57 -0500 Subject: [PATCH] two dists for release --- .github/workflows/ci.yml | 6 +++--- package.json | 3 ++- webpack.config.js | 8 +++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03116c3..a1934a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,13 +22,13 @@ jobs: run: pnpm install - name: Build - run: npm run build + run: npm run build:shrunk-dev && mv -r dist shrunk-dev-dist && npm run build:shrunk-prod && mv -r dist shrunk-prod-dist - name: Archive Production Build - run: zip -r dist.zip dist/ + run: zip -r shrunk-dev-dist.zip shrunk-dev-dist/ && zip -r shrunk-prod-dist.zip shrunk-prod-dist/ - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: - files: dist.zip \ No newline at end of file + files: shrunk-dev-dist.zip shrunk-prod-dist.zip diff --git a/package.json b/package.json index a05856e..441345f 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "dev_server_port": 3000 }, "scripts": { - "build": "webpack --mode production", + "build:shrunk-test": "webpack --env urlProd=shrunk.rutgers.edu --mode production", + "build:shrunk-prod": "webpack --env urlProd=go.rutgers.edu --mode production", "build:dev": "webpack --mode development", "dev-server": "webpack serve --mode development", "lint": "office-addin-lint check", diff --git a/webpack.config.js b/webpack.config.js index 3312611..2f48f99 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,7 +5,6 @@ const CopyWebpackPlugin = require("copy-webpack-plugin"); const HtmlWebpackPlugin = require("html-webpack-plugin"); const urlDev = "https://localhost:3000/"; -const urlProd = "https://www.contoso.com/"; // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION async function getHttpsOptions() { const httpsOptions = await devCerts.getHttpsServerOptions(); @@ -14,6 +13,13 @@ async function getHttpsOptions() { module.exports = async (env, options) => { const dev = options.mode === "development"; + + if (!env.urlProd) { + throw new Error("urlProd is required"); + } + + const urlProd = env.urlProd; + const config = { devtool: "source-map", entry: {