jwanner83 / viteray

Use vite dev server for liferay portlets!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

viteray

npm GitHub

Zero-config module to use vite for liferay portlet development.

Highlights:

  • Creates a local proxy for your liferay instance
  • No configuration for this module required
  • Supports (almost) all vite plugins
  • Supports portlet assets folder

How-to

  1. Install viteray
npm i -D @clavis/viteray

pnpm i -D @clavis/viteray

yarn add -D @clavis/viteray
  1. Add a vite.config.js file
// vite.config.js
export default {
  // config options
};

Note on plugin support:
Pretty much all plugins are supported. However, if a plugin uses the "transformIndexHtml" API, the hot module reload functionality may be limited.

React example:

import react from '@vitejs/plugin-react';

export default {
  plugins: [react()],
};
  1. Add a script to your package.json.
    Specify the url of your instance with the argument "-u".
{
  "scripts": {
    "dev": "viteray -u http://example.com"
  }
}
  1. Run!
npm run dev

pnpm run dev

yarn dev

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Jonas Wanner

🤔

This project follows the all-contributors specification. Contributions of any kind welcome!

About

Use vite dev server for liferay portlets!

License:MIT License


Languages

Language:TypeScript 81.2%Language:JavaScript 18.8%