Skip to content

Commit 461cfdd

Browse files
authored
Don't use /public path for custom functions with shared runtime (#393)
don't use /public path with shared runtime The shared runtime uses the browser context for execution of JavaScript custom functions, so the functions.json metadata can come from the dist folder just like the other files.
1 parent 62a92dd commit 461cfdd

File tree

5 files changed

+7
-15
lines changed

5 files changed

+7
-15
lines changed

manifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@
9292
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
9393
</bt:Images>
9494
<bt:Urls>
95-
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/public/functions.js" />
96-
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/public/functions.json" />
95+
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/functions.js" />
96+
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/functions.json" />
9797
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812" />
9898
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
9999
</bt:Urls>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3001/assets/icon-80.png"/>
5757
</bt:Images>
5858
<bt:Urls>
59-
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3001/public/functions.js"/>
60-
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3001/public/functions.json"/>
59+
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3001/functions.js"/>
60+
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3001/functions.json"/>
6161
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3001/taskpane.html"/>
6262
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/>
6363
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3001/taskpane.html"/>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
<bt:Image id="Icon.80x80" DefaultValue="https://localhost:3000/assets/icon-80.png"/>
5757
</bt:Images>
5858
<bt:Urls>
59-
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/public/functions.js"/>
60-
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/public/functions.json"/>
59+
<bt:Url id="Functions.Script.Url" DefaultValue="https://localhost:3000/functions.js"/>
60+
<bt:Url id="Functions.Metadata.Url" DefaultValue="https://localhost:3000/functions.json"/>
6161
<bt:Url id="Functions.Page.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
6262
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/>
6363
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,6 @@ module.exports = async (env, options) => {
8686
}),
8787
],
8888
devServer: {
89-
static: {
90-
directory: path.resolve("./", "dist"),
91-
publicPath: "/public",
92-
},
9389
headers: {
9490
"Access-Control-Allow-Origin": "*",
9591
},

webpack.config.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,14 @@ module.exports = async (env, options) => {
8686
if (dev) {
8787
return content;
8888
} else {
89-
return content.toString().replace(new RegExp(urlDev + "(?:public/)?", "g"), urlProd);
89+
return content.toString().replace(urlDev, urlProd);
9090
}
9191
},
9292
},
9393
],
9494
}),
9595
],
9696
devServer: {
97-
static: {
98-
directory: path.join(__dirname, "dist"),
99-
publicPath: "/public",
100-
},
10197
headers: {
10298
"Access-Control-Allow-Origin": "*",
10399
},

0 commit comments

Comments
 (0)