0.0.11 • Published 27 days ago

@junobuild/vite-plugin v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
27 days ago

npm license

Juno Vite Plugin

A Vite plugin for Juno.

Getting started

The plugin automatically loads your Satellite and Orbiter IDs.

With these values, you can instantiate Juno in your code without the need to manually define environment variables.

await Promise.all([
  initJuno({
    satelliteId: import.meta.env.VITE_SATELLITE_ID
  }),
  initOrbiter({
    satelliteId: import.meta.env.VITE_SATELLITE_ID,
    orbiterId: import.meta.env.VITE_ORBITER_ID
  })
]);

Environment variables

Those following environment variables are injected by this plugin:

Environment variableValue in mode developmentValue for other modes
VITE_SATELLITE_IDjx5yt-yyaaa-aaaal-abzbq-caiThe Satellite ID for the mode from your Juno configuration file.
VITE_ORBITER_IDundefinedThe Orbiter ID from your Juno configuration file.
VITE_INTERNET_IDENTITY_IDrdmx6-jaaaa-aaaaa-aaadq-cairdmx6-jaaaa-aaaaa-aaadq-cai
VITE_ICP_LEDGER_IDryjl3-tyaaa-aaaaa-aaaba-cairyjl3-tyaaa-aaaaa-aaaba-cai
VITE_ICP_INDEX_IDqhbym-qaaaa-aaaaa-aaafq-caiqhbym-qaaaa-aaaaa-aaafq-cai

VITE_ is the default prefix used by Vite. It can be customized as described in Vite's documentation.

Installation

npm i @junobuild/vite-plugin -D

Usage

// vite.config.js
import juno from '@junobuild/vite-plugin';

export default defineConfig({
  plugins: [juno()]
});

Options

The plugins can be initialized with the following options:

  • container: true to use Juno Docker with default options, or specify an object.

The object accepts the following parameters:

  • An optional url as string, representing the container URL including the port, e.g. http://127.0.0.1:8000.
  • An optional list of modes for which the container should be used.

By default, the container is mounted only in development mode.

// vite.config.js
import juno from '@junobuild/vite-plugin';

export default defineConfig({
  plugins: [
    juno({
      container: true
    })
  ]
});

License

MIT © David Dal Busco

0.0.10

27 days ago

0.0.11

27 days ago

0.0.9

1 month ago

0.0.8

2 months ago

0.0.7

2 months ago

0.0.6

4 months ago

0.0.5

5 months ago

0.0.4

5 months ago

0.0.3

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago