Skip to content

Commit

Permalink
feat(html-test-app): add default index file
Browse files Browse the repository at this point in the history
  • Loading branch information
danielleroux committed Oct 10, 2022
1 parent cd9ac90 commit a9a0608
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
22 changes: 22 additions & 0 deletions packages/html-test-app/src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--
SPDX-FileCopyrightText: 2022 Siemens AG
SPDX-License-Identifier: MIT
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<!-- Preview code -->
<ix-button id="test-button" class="m-1" variant="primary">Button</ix-button>
<!-- Preview code -->
<script type="module" src="./main.js"></script>
</body>
</html>
23 changes: 23 additions & 0 deletions packages/html-test-app/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* SPDX-FileCopyrightText: 2022 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import '@siemens/ix-icons/dist/css/ix-icons.css';
import '@siemens/ix/dist/siemens-ix/siemens-ix.css';
import { applyPolyfills, defineCustomElements } from '@siemens/ix/loader';

(async () => {
await applyPolyfills();
await defineCustomElements();

console.log('Hello World!');

const button = document.getElementById('test-button');
button.addEventListener('click', () => {
alert('Alert works!');
});
})();
5 changes: 4 additions & 1 deletion packages/html-test-app/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ export default defineConfig({
build: {
minify: false,
rollupOptions: {
input,
input: {
index: './src/index.html',
...input,
},
},
outDir: path.join(__dirname, 'dist'),
},
Expand Down

0 comments on commit a9a0608

Please sign in to comment.