Skip to content

Commit

Permalink
build: Improve build and reduce bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
spuxx-dev committed Feb 20, 2025
1 parent 633e834 commit a6b9cc6
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 21 deletions.
8 changes: 5 additions & 3 deletions packages/solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
"types": "./dist/main.d.ts",
"import": "./dist/main.js"
},
"./styles": {
"import": "./dist/main.css"
"./modal": {
"types": "./dist/modal.d.ts",
"import": "./dist/modal.js"
}
},
"files": [
Expand Down Expand Up @@ -67,7 +68,8 @@
"@iconify-icon/solid": "^2.3.0",
"@spuxx/browser-utils": "workspace:@spuxx/browser-utils@*",
"@spuxx/js-utils": "^1.3.0",
"solid-js": "^1.9.0"
"solid-js": "^1.9.0",
"@corvu/dialog": "^0.2.4"
},
"dependencies": {
"@corvu/dialog": "0.2.4"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { JSX, Show, type Component } from 'solid-js';
import { ButtonProps } from './button.types';
import { Icon, IconifyIcon } from '@iconify-icon/solid';
import { classNames } from '@main';
import { classNames } from '@src/main';

export const Button: Component<ButtonProps> = (props) => {
const { variant = 'contained', color = 'primary', rounded, loading } = props;
Expand Down
2 changes: 1 addition & 1 deletion packages/solid/src/components/input/button/button.types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IconifyIcon } from '@iconify-icon/solid';
import { JSX, ParentProps } from 'solid-js';
import { BaseColor, ContentColor } from '@spuxx/browser-utils';
import { ComponentProps } from '@main';
import { ComponentProps } from '@src/main';

export interface ButtonProps extends ComponentProps<HTMLButtonElement>, ParentProps {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Dynamic } from 'solid-js/web';
import { Component } from 'solid-js';
import { ContainerProps } from './container.types';
import { classNames } from '@main';
import { classNames } from '@src/main';

/**
* A container component. Very flexible and can be used for most layout purposes.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BaseColor } from '@spuxx/browser-utils';
import { ComponentProps } from '@main';
import { ComponentProps } from '@src/main';
import { ParentProps } from 'solid-js';

export interface ContainerProps extends ComponentProps<HTMLElement>, ParentProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from 'solid-js';
import { DividerProps } from './divider.types';
import { classNames } from '@main';
import { classNames } from '@src/main';

/**
* A divider component. Can be used to separate content. Supports vertical orientation.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BaseColor, ContentColor } from '@spuxx/browser-utils';
import { ComponentProps } from '@main';
import { ComponentProps } from '@src/main';

export interface DividerProps extends ComponentProps<HTMLHRElement> {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { type Component } from 'solid-js';
import { HeadingProps } from './heading.types';
import { classNames } from '@main';
import { classNames } from '@src/main';

export const Heading: Component<HeadingProps> = (props) => {
const { level } = props;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComponentProps } from '@main';
import { ComponentProps } from '@src/main';
import { ParentProps } from 'solid-js';

export interface HeadingProps extends ComponentProps<HTMLHeadingElement>, ParentProps {
Expand Down
2 changes: 0 additions & 2 deletions packages/solid/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ export * from './components/layout/container';
export * from './components/layout/divider';
export * from './components/typography/heading';

export * from './modal';

export * from './utils/component.utils';
7 changes: 2 additions & 5 deletions packages/solid/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"extends": "./tsconfig.json",
"exclude": [
"**/*.test.ts",
"**/*.test.tsx"
]
}
"exclude": ["**/*.test.ts", "**/*.test.tsx"]
}
1 change: 0 additions & 1 deletion packages/solid/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"resolveJsonModule": true,
"baseUrl": ".",
"paths": {
"@main": ["./src/main.ts"],
"@src/*": ["./src/*"]
}
}
Expand Down
8 changes: 6 additions & 2 deletions packages/solid/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,24 @@ export default defineConfig({
rollupTypes: true,
}),
tsconfigPaths({
configNames: ['tsconfig.build.json']
configNames: ['tsconfig.build.json'],
}),
],
build: {
target: 'esnext',
lib: {
entry: {
main: './src/main.ts',
modal: './src/modal/index.ts',
},
name: '@spuxx/solid',
formats: ['es'],
},
rollupOptions: {
external: [...Object.keys(peerDependencies)],
external: [/^solid-js($|\/)/, ...Object.keys(peerDependencies)],
output: {
preserveModules: true,
}
},
},
test: {
Expand Down

0 comments on commit a6b9cc6

Please sign in to comment.