From 6041b85e99386a5ef21e8fd78b9853030c54a8c7 Mon Sep 17 00:00:00 2001 From: Courtney Owen Date: Wed, 9 Sep 2020 15:32:34 -0700 Subject: [PATCH] Merge office-addin-taskpane/master --- manifest.xml | 10 +++++----- src/taskpane/taskpane.ts | 4 ++++ test/test-manifest.xml | 9 ++++++--- webpack.config.js | 20 +++++++++++++++++++- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/manifest.xml b/manifest.xml index 80838e8..d87546f 100644 --- a/manifest.xml +++ b/manifest.xml @@ -1,7 +1,7 @@ - - + ca968be6-628b-4f14-ba3c-3e614effa9bd 1.0.0.0 @@ -13,7 +13,7 @@ - contoso.com + https://www.contoso.com diff --git a/src/taskpane/taskpane.ts b/src/taskpane/taskpane.ts index fbf461b..8bbf97e 100644 --- a/src/taskpane/taskpane.ts +++ b/src/taskpane/taskpane.ts @@ -2,6 +2,10 @@ * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. * See LICENSE in the project root for license information. */ +// images references in the manifest +import "../../assets/icon-16.png"; +import "../../assets/icon-32.png"; +import "../../assets/icon-80.png"; /* global console, document, Excel, Office */ // The initialize function must be run each time a new page is loaded diff --git a/test/test-manifest.xml b/test/test-manifest.xml index 574c173..29d05f3 100644 --- a/test/test-manifest.xml +++ b/test/test-manifest.xml @@ -1,5 +1,8 @@ - - + + a2b37988-b6e8-46df-871e-1cf3cb3d604d 1.0.0.0 Contoso @@ -10,7 +13,7 @@ - contoso.com + https://www.contoso.com diff --git a/webpack.config.js b/webpack.config.js index d4f69e4..59d89b7 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,8 +5,12 @@ const CustomFunctionsMetadataPlugin = require("custom-functions-metadata-plugin" const HtmlWebpackPlugin = require("html-webpack-plugin"); const webpack = require("webpack"); +const urlDev="https://localhost:3000/"; +const urlProd="https://www.contoso.com/"; // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION + module.exports = async (env, options) => { const dev = options.mode === "development"; + const buildType = dev ? "dev" : "prod"; const config = { devtool: "source-map", entry: { @@ -37,7 +41,10 @@ module.exports = async (env, options) => { }, { test: /\.(png|jpg|jpeg|gif)$/, - use: "file-loader" + loader: "file-loader", + options: { + name: '[path][name].[ext]', + } } ] }, @@ -63,6 +70,17 @@ module.exports = async (env, options) => { { to: "taskpane.css", from: "./src/taskpane/taskpane.css" + }, + { + to: "[name]." + buildType + ".[ext]", + from: "manifest*.xml", + transform(content) { + if (dev) { + return content; + } else { + return content.toString().replace(new RegExp(urlDev, "g"), urlProd); + } + } } ]), new HtmlWebpackPlugin({