Skip to content

Commit

Permalink
fix(templates): fix vite config
Browse files Browse the repository at this point in the history
  • Loading branch information
ruidias-commercetools committed Jul 16, 2024
1 parent bf27c77 commit 4f0acb4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
1 change: 0 additions & 1 deletion application-templates/typescript/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/assets/static/commercetools.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/src/index.css">
<title>Connect Asset</title>
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions application-templates/typescript/assets/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import commercetoolsLogo from '../static/commercetools.svg';
import './index.css';

export const alertMessage = () => {
alert('Hello! You are now using the Connect Asset Application template!');
Expand Down
11 changes: 0 additions & 11 deletions application-templates/typescript/assets/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
import { defineConfig } from 'vite';
import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

export default defineConfig({
plugins: [cssInjectedByJsPlugin()],
build: {
outDir: resolve(__dirname, 'public'),
lib: {
// Could also be a dictionary or array of multiple entry points
entry: resolve(__dirname, 'src/main.ts'),

name: 'Connector Asset Template',
formats: ['es', 'umd'],
// the proper extensions will be added
fileName: (format) => `connector-asset.${format}.js`,
},
},
});

0 comments on commit 4f0acb4

Please sign in to comment.