3.4.0 • Published 6 months ago

@junobuild/vite-plugin v3.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months 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([initSatellite(), initOrbiter()]);

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_NNS_GOVERNANCE_IDrrkah-fqaaa-aaaaa-aaaaq-cairrkah-fqaaa-aaaaa-aaaaq-cai
VITE_CMC_IDrkp4c-7iaaa-aaaaa-aaaca-cairkp4c-7iaaa-aaaaa-aaaca-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 plugin can be customized using the optional juno configuration object. This allows you to control how the Juno Docker container is used in your project, especially during local development or end-to-end (E2E) testing.

juno.container

Use the container option to enable, disable, or fine-tune the use of Juno Docker.

You can provide:

  • false — to disable the container entirely.
  • true — to enable the container with default settings (only in development mode), which is also the default behavior.
  • An object with the following fields:
    • url (string, optional): A custom container URL, including the port. Example: http://127.0.0.1:8000
    • modes (string[], optional): An array of modes (e.g., 'development', 'test') during 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: {
        url: 'http://127.0.0.1:8000',
        modes: ['development', 'test']
      }
    })
  ]
});

License

MIT © David Dal Busco

1.0.0

7 months ago

0.0.19

11 months ago

2.0.0

7 months ago

3.4.0

6 months ago

3.3.0

7 months ago

3.1.0

7 months ago

3.0.0

7 months ago

0.0.18

1 year ago

0.0.14

1 year ago

0.0.15

1 year ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago