Open MangelMaxime opened 7 years ago
Just a quick update, I finally go with Webpack2 because I couldn't make the code splitting work with Rollup. I wanted to split the vendor from the app to get the app reload faster in dev mode.
So with Webpack2 I can use either import or require now. Still my question remain :)
Try importing the newer metapackage called flimflam
on npm, which comes with a newer version of the render
function that has patch bundled inside it, already intialized:
import h from 'flimflam/h'
import render from 'flimflam/render'
function init() { return {hi: 'hi'} }
function view(state) { return h('body', 'hi') }
// Newer render function has the signature: render(view, state, container)
const container = document.body
render(view, init(), container)
Hello, I am starting to play with FlimFlam and I decided to go with Rollup (ES6) + Gulp for the build tasks.
I had some problem with those lines:
I was having an error:
Uncaught ReferenceError: require is not defined
I tryed to use:
And with now it's working. Is there any reason to prefer require compare to import ?