mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 22:47:25 +01:00
add preact with webpack
This commit is contained in:
19
webapp/index.js
Normal file
19
webapp/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { render } from 'preact';
|
||||
|
||||
function init() {
|
||||
const App = require('./views').default;
|
||||
render(App, document.getElementById('root'), document.getElementById('app'));
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
console.log('for real now');
|
||||
} else {
|
||||
// use preact's devtools
|
||||
require('preact/devtools');
|
||||
// listen for HMR
|
||||
if (module.hot) {
|
||||
module.hot.accept('./views', init);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user