Giter Club home page Giter Club logo

Comments (3)

simonrepp avatar simonrepp commented on June 12, 2024 1

I'm so far using https://parceljs.org/ (v1 for now as I didn't migrate to v2 yet) to produce the two isolated javascript application bundles on eno-lang.org that use enolib client-side in the browser (the eno playground and enolib playground).

Both bundler invocations can be found in the package scripts for eno-lang.org:
https://github.com/eno-lang/eno-lang.org/blob/a93c4f1ee461668535ae2f9960619bbaa2eb95d7/package.json#L32-L33

The respective files being built (which both import enolib) are playground.js and enolib_playground.js.

I believe in the past I have also used webpack for this, but I'd need to dig around a bit to find that again.

Let me know if these examples/links help you out, fingers crossed! If you want to share your results afterwards (given it's a public thing anyway) I'd be curious to have a look too ;) feel free to post a link if that's the case!

from enolib.

mestaritonttu avatar mestaritonttu commented on June 12, 2024 1

Thanks a lot, it is working! Instead of just glancing at the code, I should have tested the Browserify and Rollup outputs as well - looks like they define a require() function like Parcel. But I will stick with Parcel (used 1.12.5).

I used a file like this:

import enolib, { parse, HtmlReporter, ParseError } from 'enolib';
const test = `name: test`; // imagine multi-line eno data here
const doc = enolib.parse(test); 
console.log(doc.field('name').requiredStringValue());

and built with
parcel build enorequire.js --no-source-maps --out-dir ./ --out-file enolib.js

from enolib.

simonrepp avatar simonrepp commented on June 12, 2024

Fantastic, great to hear it's working! :)

from enolib.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.