WebReflection / asbundle

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

Error cant find module #17

Closed pinguxx closed 6 years ago

pinguxx commented 6 years ago

using this file

import HyperHTMLElement from 'hyperhtml-element/esm';
const { wire } = HyperHTMLElement;

then doing asbundle main.js i get

module.js:550
    throw err;
    ^

Error: Cannot find module 'hyperhtml-element/esm'
    at Function.Module._resolveFilename (module.js:548:15)

any idea?

WebReflection commented 6 years ago

as bundle expect paths you can transform via CJS, in this case you want to import either hyperhtml-element or hyperhtml-element/cjs.

For anything more complex I suggest rollback 👋

pinguxx commented 6 years ago

rollup i assume?, im using rollup i was just trying to generate a cjs version of the files easily... but probably not required since they are custom elements..........

WebReflection commented 6 years ago

Yes, rollup, stupid phone