0.10.3 • Published 1 year ago

vite-plugin-imba v0.10.3

Weekly downloads
1
License
MIT
Repository
github
Last release
1 year ago

vite-plugin-imba

The official Imba plugin for Vite.

Usage

// vite.config.js
import { defineConfig } from 'vite';
import { imba } from 'vite-plugin-imba';

export default defineConfig({
  plugins: [
    imba({
		/* plugin options */
	})
  ]
});

Options

Config file

Config file resolving

Besides inline options in Vite config, vite-plugin-imba will also automatically resolve options from an Imba config file if it exists (imbaconfig.json or imba.config.js). The JavaScript one is recommended since we'll add a defineConfig helper function to provide autocomplete for the options in the future

To set a specific config file, use the configFile inline option. The path can be absolute or relative to the Vite root. For example:

// vite.config.js
export default defineConfig({
  plugins: [
    imba({
      configFile: 'my-imba-config.json'
    })
  ]
});

A basic Imba config looks like this:

// imba.config.js
export default {
  // imba options
  theme: {}
};

Disable automatic handling of Imba config

Use configFile: false to prevent vite-plugin-imba from reading the config file or restarting the Vite dev server when it changes.

// vite.config.js
export default defineConfig({
  plugins: [
    imba({
      configFile: false
      // your imba config here
    })
  ]
});

Warning: You are responsible to provide the complete inline config when used.

Imba options

These options are specific to the Imba compiler.

compilerOptions

  • You can specify your own pallette of colors using
// vite.config.js
export default defineConfig({
  plugins: [imba({
		compilerOptions: {
			theme: {
				colors: {
					"myblue": "blue",
					"lilac": {
						"2": "hsl(253, 100%, 95%)",
						"4": "hsl(252, 100%, 86%)"
					},
				}
			}
		}
	})],
});

Imba will take care of generating color variants from 1 to 9 based on the provided values.

Full stack Usage

In order to use the plugin both in the client and the server (with SSR and hydration), see the example in ../e2e-tests/vite-ssr-esm

Credits

  • imba vite plugin

License

MIT

0.10.2

1 year ago

0.10.3

1 year ago

0.10.0

2 years ago

0.10.1

2 years ago

0.9.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.9.0

2 years ago

0.7.2

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.8.2

2 years ago

0.7.3

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.0.3

4 years ago

0.0.2

4 years ago