-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(pci-common): add vite config to publish library
ref: TAPC-2321 Signed-off-by: Anoop N <[email protected]>
- Loading branch information
1 parent
308cc8f
commit fd22bd6
Showing
5 changed files
with
139 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# ⚛️⚡ Public Could Manager Common Components Library | ||
|
||
## Features | ||
|
||
Hosts the shared components used in manager for the Public Cloud universe | ||
Keep it as simple as possible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
packages/manager/modules/manager-pci-common/vite.config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import react from '@vitejs/plugin-react'; | ||
import { defineConfig } from 'vitest/config'; | ||
import dts from 'vite-plugin-dts'; | ||
import path from 'path'; | ||
import tailwindcss from 'tailwindcss'; | ||
import { getBaseConfig } from '@ovh-ux/manager-vite-config'; | ||
import * as packageJson from './package.json'; | ||
|
||
const baseConfig = getBaseConfig({}); | ||
const pathSrc = path.resolve(__dirname, 'src'); | ||
const externalDeps = [ | ||
...Object.keys(packageJson.peerDependencies || {}), | ||
'@ovhcloud/ods-components/react', | ||
]; | ||
|
||
export default defineConfig({ | ||
...baseConfig, | ||
resolve: { | ||
alias: { | ||
'@/': pathSrc, | ||
}, | ||
}, | ||
plugins: [ | ||
react(), | ||
dts({ | ||
root: __dirname, | ||
insertTypesEntry: true, | ||
outDir: 'dist/types', | ||
}), | ||
/* | ||
* Visualizer emits an HTML file that allows to check what's really included in the bundle. | ||
* Uncomment if you want to run the plugin and check the output dist. | ||
* Be sure that plugin is installed before and well imported. | ||
*/ | ||
// visualizer({ | ||
// filename: 'stats/bundle-analysis.html', | ||
// }), | ||
], | ||
css: { | ||
postcss: { | ||
plugins: [tailwindcss], | ||
}, | ||
}, | ||
test: { | ||
globals: true, | ||
environment: 'jsdom', | ||
}, | ||
build: { | ||
outDir: path.resolve(__dirname, 'dist'), | ||
emptyOutDir: true, | ||
lib: { | ||
entry: path.resolve(pathSrc, 'index.ts'), | ||
name: 'ManagerPciCommonLib', | ||
fileName: 'index', | ||
formats: ['es'], | ||
}, | ||
rollupOptions: { | ||
external: (id) => | ||
externalDeps.some((dep) => id === dep || id.startsWith(`${dep}/`)), | ||
}, | ||
sourcemap: 'hidden', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters