1.0.1 • Published 5 years ago

hmr-indicator v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

hmr-indicator

Visible indication of hot app reload

Install

npm i -D hmr-indicator

or

yarn add -D hmr-indicator

Use

if (module.hot) {
    module.hot.accept()
    if (process.env.NODE_ENV === 'development') {
        require('hmr-indicator').default()
    }
}

Customize

require('hmr-indicator').default({
    favicon: false,
    center: { text: 'OK' },
    duration: 1000,
})

Options & defaults

let centerDefaults = {
    text: '\u27F3',
    style: 'color: #11FF11; font-size: 200px; position: absolute; top: 50%; left: 50%; margin-top: -100px; margin-left: -100px',
}

let faviconDefaults = {
    text: '\u27F3',
    color: '#11FF11',
    font: 'bold 32px serif',
}