@prefresh/vite
TypeScript icon, indicating that this package has built-in type declarations

2.4.6 • Public • Published

Prefresh-vite

npm version

Setup

npm i -s @prefresh/vite
## OR
yarn add @prefresh/vite

Then add it to your vite.config.js config:

import prefresh from '@prefresh/vite';

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

Options

The plugin accepts two options include & exclude which are used in the @rollup/pluginutils.createFilter to filter out files or include them.

The plugin also accepts the addition of parserPlugins

Best practices

Recognition

We need to be able to recognise your components, this means that components should start with a capital letter and hook should start with use followed by a capital letter. This allows the Babel plugin to effectively recognise these.

Do note that a component as seen below is not named.

export default () => {
  return <p>Want to refresh</p>;
};

Instead do:

const Refresh = () => {
  return <p>Want to refresh</p>;
};

export default Refresh;

When you are working with HOC's be sure to lift up the displayName so we can recognise it as a component.

Readme

Keywords

none

Package Sidebar

Install

npm i @prefresh/vite

Weekly Downloads

58,897

Version

2.4.6

License

MIT

Unpacked Size

7.27 kB

Total Files

5

Last publish

Collaborators

  • jdecroock
  • marvinhagemeister
  • developit