Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing @neotools/bundler separately? #6

Open
geelen opened this issue Jul 12, 2021 · 1 comment
Open

Publishing @neotools/bundler separately? #6

geelen opened this issue Jul 12, 2021 · 1 comment

Comments

@geelen
Copy link

geelen commented Jul 12, 2021

Hi there, following the thread from evanw/esbuild#690 and then your comment here: evanw/esbuild#797 (comment)

Found this repo and played around with the demo. Took me a few seconds to grok how it was put together and get the repo set up locally, but I got it working, then stripped it down to the bare essentials, and... this is incredible!

import { compileMemfs } from '@neotools/bundler'

const compiler = compileMemfs(
  {
    'index.ts': `import { answer } from './constants'; console.log('The answer is ' + answer);`,
    'constants.ts': `export const answer = 42;`,
  },
  {
    input: 'index.ts',
    hooks: {
      done(result) {
        result?.outputFiles?.forEach((f) => {
          console.log(f.path)
          console.log(f.text)
        })
      },
    },
  }
)

compiler.build()
// memfsNZ:./constants
var answer = 42;

// memfsNZ:/index.ts
console.log("The answer is " + answer);

I'm only just figuring out what I can do with it, but as far as I can tell this is way ahead of the try.html example posted here: evanw/esbuild#797 (comment)

Is there a reason this didn't get published to NPM yet? I'd be happy to help make it happen, I think it could be a useful tool for those of us exploring the space right now.

@n1ru4l
Copy link

n1ru4l commented Dec 4, 2021

We (The Guild) were very excited about the recent open-sourcing of SandBox (by CodeSandbox) but also disappointed learning that it is still tight-coupled to the CodeSandbox API.

After a bit of research, I found this and I am really impressed and started an integration for this in one of our open-source library documentation (n1ru4l/envelop#1052). We would love to collaborate on this project.

I forked this project and will make my fork public sometime this weekend or next week. The fork will also include automated publishing of the bundler to npm. In the future, we are happy to merge the fork back into the origin. Let me know what you think and feel free to send me an email or reach me via Twitter DMs if you want to discuss more. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants