@twoday/vite-plugin-super-template
TypeScript icon, indicating that this package has built-in type declarations

0.1.8 • Public • Published

@twoday/vite-plugin-super-template

Vite plugin for super-template.

Usage

vite.config.js:

import superTemplate from '@twoday/vite-plugin-super-template';
import { defineConfig } from 'vite';

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

Options

Default options can be tweaked or replaced entirely.

Replace @twoday/babel-preset-formatjs with babel-plugin-formatjs

import superTemplate, {
  defaultOptions,
} from '@twoday/vite-plugin-super-template';
import { defineConfig } from 'vite';

const withOriginalFormatJSBabelPlugin = (options) => {
  const { plugins, presets } = options.react.babel;

  const indexOftwodayFormatJSPreset = presets.findIndex(
    (preset) => preset === '@twoday/formatjs'
  );

  presets.splice(indexOftwodayFormatJSPreset, 1);
  plugins.push('formatjs');

  return options;
};

export default defineConfig({
  plugins: [superTemplate(withOriginalFormatJSBabelPlugin(defaultOptions))],
});

Readme

Keywords

none

Package Sidebar

Install

npm i @twoday/vite-plugin-super-template

Weekly Downloads

0

Version

0.1.8

License

ISC

Unpacked Size

23.5 kB

Total Files

39

Last publish

Collaborators

  • sigurs
  • arnosaine