Skip to content

Commit 25f2f21

Browse files
authored
Merge pull request #349 from millerds/improve-webpack-performance
Update static file path
2 parents 4d5bd36 + 906d9d5 commit 25f2f21

File tree

5 files changed

+20
-13
lines changed

5 files changed

+20
-13
lines changed

manifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@
8989
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
9090
</bt:Images>
9191
<bt:Urls>
92-
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/dist/functions.js" />
93-
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/dist/functions.json" />
94-
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3000/dist/functions.html" />
92+
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/public/functions.js" />
93+
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/public/functions.json" />
94+
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3000/public/functions.html" />
9595
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
9696
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html" />
9797
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html" />

test/end-to-end/test-manifest-debugging.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@
8989
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3001/assets/icon-80.png"/>
9090
</bt:Images>
9191
<bt:Urls>
92-
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3001/dist/functions.js"/>
93-
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3001/dist/functions.json"/>
94-
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3001/dist/functions.html"/>
92+
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3001/public/functions.js"/>
93+
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3001/public/functions.json"/>
94+
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3001/public/functions.html"/>
9595
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/>
9696
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3001/commands.html"/>
9797
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3001/taskpane.html"/>

test/end-to-end/test-manifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
5454
</bt:Images>
5555
<bt:Urls>
56-
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/dist/functions.js"/>
57-
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/dist/functions.json"/>
58-
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3000/dist/functions.html"/>
56+
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/public/functions.js"/>
57+
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/public/functions.json"/>
58+
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3000/public/functions.html"/>
5959
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/>
6060
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/>
6161
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>

test/end-to-end/webpack.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ module.exports = async (env, options) => {
2020
entry: {
2121
polyfill: ["core-js/stable", "regenerator-runtime/runtime"],
2222
commands: "./src/commands/commands.ts",
23-
functions: "./src/functions/functions.ts",
2423
taskpane: "./test/end-to-end/src/test-taskpane.ts",
24+
functions: "./src/functions/functions.ts",
2525
},
2626
output: {
2727
path: path.resolve(__dirname, "testBuild"),
@@ -96,7 +96,10 @@ module.exports = async (env, options) => {
9696
}),
9797
],
9898
devServer: {
99-
static: ["./"],
99+
static: {
100+
directory: path.resolve("./", "dist"),
101+
publicPath: "/public",
102+
},
100103
headers: {
101104
"Access-Control-Allow-Origin": "*",
102105
},

webpack.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const devCerts = require("office-addin-dev-certs");
44
const CopyWebpackPlugin = require("copy-webpack-plugin");
55
const CustomFunctionsMetadataPlugin = require("custom-functions-metadata-plugin");
66
const HtmlWebpackPlugin = require("html-webpack-plugin");
7+
const path = require("path");
78

89
const urlDev = "https://localhost:3000/";
910
const urlProd = "https://www.contoso.com/"; // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION
@@ -21,9 +22,9 @@ module.exports = async (env, options) => {
2122
devtool: "source-map",
2223
entry: {
2324
polyfill: ["core-js/stable", "regenerator-runtime/runtime"],
24-
functions: "./src/functions/functions.ts",
2525
taskpane: "./src/taskpane/taskpane.ts",
2626
commands: "./src/commands/commands.ts",
27+
functions: "./src/functions/functions.ts",
2728
},
2829
output: {
2930
clean: true,
@@ -103,7 +104,10 @@ module.exports = async (env, options) => {
103104
}),
104105
],
105106
devServer: {
106-
static: [__dirname],
107+
static: {
108+
directory: path.join(__dirname, "dist"),
109+
publicPath: "/public",
110+
},
107111
headers: {
108112
"Access-Control-Allow-Origin": "*",
109113
},

0 commit comments

Comments
 (0)