/malinajs-unplugin

Malina.js plugin for Vite, Rollup, ESBuild & Webpack

Primary LanguageTypeScriptMIT LicenseMIT

malinajs-unplugin

install size npm version

Usage

Vite

//vite.config.ts

import { defineConfig } from "vite";
import { vitePlugin as malinaPlugin } from "malinajs-unplugin";

export default defineConfig(({ mode }) => ({
  plugins: [
    malinaPlugin({
      debugLabel: mode === "development",
    }),
  ],
}));

Webpack

//webpack.config.js
const { webpackPlugin: malinaPlugin } = require("malinajs-unplugin");

module.exports = {
  plugins: [malinaPlugin()],
};

Caution

Be careful when using with Vite: the html extension will not work

As stated in the malinajs documentation, you can import 'malinajs' as 'malinajs/runtime'. Using unplugin, you cannot do this. Read more in the issue