refactor: hoppscotch ui (#2887)
* feat: hopp ui initialized * feat: button components added * feat: windi css integration * chore: package removed from hopp ui * feat: storybook added * feat: move all smart components hoppscotch-ui * fix: import issue from components/smart * fix: env input component import * feat: add hoppui to windicss config * fix: remove storybook * feat: move components from hoppscotch-ui * feat: storybook added * feat: storybook progress * feat: themeing storybook * feat: add stories * chore: package updated * chore: stories added * feat: stories added * feat: stories added * feat: icons resolved * feat: i18n composable resolved * feat: histoire added * chore: resolved prettier issue * feat: radio story added * feat: story added for all components * feat: new components added to stories * fix: resolved issues * feat: readme.md added * feat: context/provider added * chore: removed app component registry * chore: remove importing of all components in hopp-ui to allow code splitting * chore: fix vite config errors * chore: jsdoc added * chore: any replaced with smart-item * chore: i18n added to ui components * chore: clean up - removed a duplicate button --------- Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com> Co-authored-by: Liyas Thomas <liyascthomas@gmail.com>
This commit is contained in:
60
packages/hoppscotch-ui/vite.config.ts
Normal file
60
packages/hoppscotch-ui/vite.config.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import vue from "@vitejs/plugin-vue"
|
||||
import path from "path"
|
||||
import { FileSystemIconLoader } from "unplugin-icons/loaders"
|
||||
import IconResolver from "unplugin-icons/resolver"
|
||||
import Icons from "unplugin-icons/vite"
|
||||
import Components from "unplugin-vue-components/vite"
|
||||
import { defineConfig } from "vite"
|
||||
import WindiCSS from "vite-plugin-windicss"
|
||||
|
||||
module.exports = defineConfig({
|
||||
plugins: [
|
||||
vue(),
|
||||
WindiCSS({
|
||||
root: path.resolve(__dirname),
|
||||
}),
|
||||
Components({
|
||||
dts: "./src/components.d.ts",
|
||||
dirs: ["./src/components"],
|
||||
directoryAsNamespace: true,
|
||||
resolvers: [
|
||||
IconResolver({
|
||||
prefix: "icon",
|
||||
customCollections: ["hopp", "auth", "brands"],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
Icons({
|
||||
compiler: "vue3",
|
||||
customCollections: {
|
||||
hopp: FileSystemIconLoader("../hoppscotch-common/assets/icons"),
|
||||
auth: FileSystemIconLoader("../hoppscotch-common/assets/icons/auth"),
|
||||
brands: FileSystemIconLoader(
|
||||
"../hoppscotch-common/assets/icons/brands"
|
||||
),
|
||||
},
|
||||
}),
|
||||
], // to process SFC
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, "src/index.ts"),
|
||||
name: "hopp-ui",
|
||||
formats: ["es"], // adding 'umd' requires globals set to every external module
|
||||
fileName: (format) => `hopp-ui.${format}.js`,
|
||||
},
|
||||
rollupOptions: {
|
||||
// external modules won't be bundled into HoppUI library
|
||||
external: ["vue"], // not every external has a global
|
||||
output: {
|
||||
// disable warning on src/index.ts using both default and named export
|
||||
exports: "named",
|
||||
// Provide global variables to use in the UMD build
|
||||
// for externalized deps (not useful if 'umd' is not in lib.formats)
|
||||
globals: {
|
||||
vue: "Vue",
|
||||
},
|
||||
},
|
||||
},
|
||||
emptyOutDir: false, // to retain the types folder generated by tsc
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user