4.0.0 • Published 1 year ago

@prefresh/nollup v4.0.0

Weekly downloads
421
License
MIT
Repository
github
Last release
1 year ago

Prefresh-nollup

npm version

Setup

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

Then add it to your rollup.config.js config by doing

import prefresh from '@prefresh/nollup';

const config = {
  ...
  plugins: [
    ...
    process.env.NODE_ENV === 'development' && prefresh()
  ]
};

Ensure that --hot flag is enabled or "hot": true is set in .nolluprc.js

Using hooks

If you're using preact/hooks you'll need something extra to ensure we can handle changes in hooks well.

You'll need to add @prefresh/babel-plugin to your babel-configuration to make this work together.

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.

Credits

4.0.0

1 year ago

3.0.2

2 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.2.0

3 years ago

2.1.1

3 years ago

2.0.2

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.7.0

4 years ago

0.7.0-alpha.0

4 years ago

0.6.4

4 years ago

0.6.3

4 years ago

0.6.2

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago