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 4291541
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 25 deletions.
1 change: 0 additions & 1 deletion application-templates/javascript/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: 0 additions & 1 deletion application-templates/javascript/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"scripts": {
"dev": "vite --port 3000",
"start": "serve public -l 8080 --cors",
"test": "jest --detectOpenHandles",
"build": "vite build",
"preview": "vite preview",
"serve": "npm run build && serve public -l 3000 --cors",
Expand Down
1 change: 1 addition & 0 deletions application-templates/javascript/assets/src/main.js
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/javascript/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.js'),

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

Please sign in to comment.