WebReflection / asbundle

A minimalistic JS bundler
ISC License
78 stars 3 forks source link

Had been trying bundling for multiple js files. Not working #20

Closed the-xperimentalist closed 4 years ago

the-xperimentalist commented 4 years ago

Hey, liked how the dependencies are really less. So, I have multiple js files, with imports of methods in each other. Had been trying to bundle the main js file using as bundle. Is it possible to do that? Or this only bundles single files? I have added a simple template here:

// main2.js
export default function otherComponent = () => {
  var elem = document.createElement('div')
  elem.innerHTML = "Othere test"

  return elem
}

import otherComponent from './main2.js'

function component() {
    const newComponent = document.createElement("div")
    newComponent.innerHTML = "Hello world"
    return newComponent
}

document.body.appendChild(component())
document.body.appendChild(otherComponent())
WebReflection commented 4 years ago

the whole project is about resolving imports and creating commonjs friendly bundlers, so I'm not sure what's your problem, as I've been using this in that exact way for ages 🤔

WebReflection commented 4 years ago

beside the fact you have a syntax error in there ...

export default function otherComponent = () => {

this bundler doesn't solve syntax erros for you