Skip to content

Commit c475fe3

Browse files
author
Bruno Carvalhal
committed
Improve file structure
1 parent 8fe05e6 commit c475fe3

File tree

6 files changed

+18
-15
lines changed

6 files changed

+18
-15
lines changed

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
1818
"prettier": "office-addin-lint prettier",
1919
"preview": "vite preview",
20-
"start": "office-addin-debugging start manifest.xml",
21-
"start:desktop": "office-addin-debugging start manifest.xml desktop",
22-
"start:web": "office-addin-debugging start manifest.xml web",
23-
"stop": "office-addin-debugging stop manifest.xml",
24-
"validate": "office-addin-manifest validate manifest.xml"
20+
"start": "office-addin-debugging start src/manifest.xml",
21+
"start:desktop": "office-addin-debugging start src/manifest.xml desktop",
22+
"start:web": "office-addin-debugging start src/manifest.xml web",
23+
"stop": "office-addin-debugging stop src/manifest.xml",
24+
"validate": "office-addin-manifest validate src/manifest.xml"
2525
},
2626
"dependencies": {
2727
"@fluentui/react": "^8.52.3",

commands.html src/commands/commands.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<!-- Office JavaScript API -->
1111
<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js"></script>
12-
<script type="module" src="/src/commands/commands.ts"></script>
12+
<script type="module" src="/commands/commands.ts"></script>
1313
</head>
1414

1515
<body>

manifest.xml src/manifest.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<Host Name="Workbook"/>
1717
</Hosts>
1818
<DefaultSettings>
19-
<SourceLocation DefaultValue="https://localhost:3000/taskpane.html"/>
19+
<SourceLocation DefaultValue="https://localhost:3000/taskpane/taskpane.html"/>
2020
</DefaultSettings>
2121
<Permissions>ReadWriteDocument</Permissions>
2222
<VersionOverrides xmlns="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="VersionOverridesV1_0">
@@ -68,8 +68,8 @@
6868
</bt:Images>
6969
<bt:Urls>
7070
<bt:Url id="GetStarted.LearnMoreUrl" DefaultValue="https://go.microsoft.com/fwlink/?LinkId=276812"/>
71-
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands.html"/>
72-
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane.html"/>
71+
<bt:Url id="Commands.Url" DefaultValue="https://localhost:3000/commands/commands.html"/>
72+
<bt:Url id="Taskpane.Url" DefaultValue="https://localhost:3000/taskpane/taskpane.html"/>
7373
</bt:Urls>
7474
<bt:ShortStrings>
7575
<bt:String id="GetStarted.Title" DefaultValue="Get started with your sample add-in!"/>

taskpane.html src/taskpane/taskpane.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-core/11.0.0/css/fabric.min.css" />
1919

2020
<!-- Template styles -->
21-
<link href="/src/taskpane/taskpane.css" rel="stylesheet" type="text/css" />
22-
<script type="module" src="/src/taskpane/index.tsx"></script>
21+
<link href="/taskpane/taskpane.css" rel="stylesheet" type="text/css" />
22+
<script type="module" src="/taskpane/index.tsx"></script>
2323
</head>
2424

2525
<body class="ms-font-m ms-Fabric">
File renamed without changes.

vite.config.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ async function getHttpsOptions() {
1414
export default defineConfig(async ({mode}) => ({
1515
plugins: [react(), eslint(), officeAddin({
1616
devUrl: "https://localhost:3000",
17-
prodUrl: "https://www.contoso.com/" // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION
17+
prodUrl: "https://www.contoso.com" // CHANGE THIS TO YOUR PRODUCTION DEPLOYMENT LOCATION
1818
})],
19+
root: "src",
1920
build: {
2021
rollupOptions: {
2122
input: {
22-
"taskpane": "taskpane.html",
23-
"commands": "commands.html",
23+
"taskpane": "/taskpane/taskpane.html",
24+
"commands": "/commands/commands.html",
2425
},
25-
}
26+
},
27+
outDir: "../dist",
28+
emptyOutDir: true
2629
},
2730
server: mode !== "production" ? { https: await getHttpsOptions() } : {}
2831
}));

0 commit comments

Comments
 (0)