JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 187
  • Score
    100M100P100Q88527F
  • License Apache-2.0

Package Exports

  • @jay-framework/vite-plugin
  • @jay-framework/vite-plugin/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jay-framework/vite-plugin) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Jay Vite Plugin

The plugin transform .jay-html files and jay component files as part of a vite build.

The plugin is a regular vite plugin setup in the vite.config.ts file.

An example config

import { resolve } from 'path';
import Inspect from 'vite-plugin-inspect';
import { defineConfig } from 'vitest/config';
import { JayRollupConfig, jayRuntime } from '@jay-framework/vite-plugin';
import { rimrafSync } from 'rimraf';

const root = resolve(__dirname);
const jayOptions: JayRollupConfig = {
  tsConfigFilePath: resolve(root, 'tsconfig.json'),
  outputDir: 'build/@jay-framework/runtime',
};

export default defineConfig(({ mode }) => {
  const external =
    mode === 'production'
      ? []
      : [
          '@jay-framework/component',
          '@jay-framework/reactive',
          '@jay-framework/runtime',
          '@jay-framework/secure',
        ];
  rimrafSync(resolve(root, 'build'));

  return {
    plugins: [Inspect(), jayRuntime(jayOptions)],
    worker: {
      plugins: () => [jayRuntime(jayOptions)],
    },
    root,
    optimizeDeps: { entries: [] },
    build: {
      emptyOutDir: true,
      minify: false,
      target: 'es2020',
      rollupOptions: { external },
    },
  };
});

See full example at counter

configuration:

The plugin configuration JayRollupConfig includes

  • tsConfigFilePath?: string - optional - path for the tsconfig file to use for building jay files.
  • tsCompilerOptionsOverrides?: CompilerOptions - optional - path for compiler options used for building jay files
  • outputDir?: string - optional - output dir to write individual transformed / generated files into.
  • isWorker?: boolean - not need for vite (required when using rollup directly without vite)
  • compilerPatternFiles?: string[] - compiler pattern files used for secure file splitting. See more info at secure