https://github.com/yhdgms1/malinajs-unplugin
Malina.js plugin for Vite, Rollup, ESBuild & Webpack
https://github.com/yhdgms1/malinajs-unplugin
esbuild-plugin malinajs rollup-plugin unplugin vite-plugin webpack-plugin
Last synced: about 1 year ago
JSON representation
Malina.js plugin for Vite, Rollup, ESBuild & Webpack
- Host: GitHub
- URL: https://github.com/yhdgms1/malinajs-unplugin
- Owner: yhdgms1
- License: mit
- Created: 2021-09-18T15:22:21.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-05-09T18:18:49.000Z (about 3 years ago)
- Last Synced: 2024-10-23T10:18:17.573Z (over 1 year ago)
- Topics: esbuild-plugin, malinajs, rollup-plugin, unplugin, vite-plugin, webpack-plugin
- Language: TypeScript
- Homepage:
- Size: 154 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# malinajs-unplugin
[](https://packagephobia.com/result?p=malinajs-unplugin@latest)
[](https://www.npmjs.com/package/malinajs-unplugin)
## Usage
### Vite
```ts
//vite.config.ts
import { defineConfig } from "vite";
import { vitePlugin as malinaPlugin } from "malinajs-unplugin";
export default defineConfig(({ mode }) => ({
plugins: [
malinaPlugin({
debugLabel: mode === "development",
}),
],
}));
```
### Webpack
```js
//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](https://malinajs.github.io/docs/#context) in the malinajs documentation, you can import 'malinajs' as 'malinajs/runtime'.
Using unplugin, you cannot do this. [Read more in the issue](https://github.com/Artemis69/malinajs-unplugin/issues/1#issuecomment-938657122)