spider icon indicating copy to clipboard operation
spider copied to clipboard

Browserify Transform, Webpack Loader

Open nmn opened this issue 10 years ago • 7 comments

Would be great to have these.

nmn avatar Nov 18 '14 18:11 nmn

Can you please further explain?

alongubkin avatar Nov 18 '14 22:11 alongubkin

This is similar to having a gulp plug-in. Browserify and Webpack are both commonjs bundlers. It would great to have plug-in to those two tools, so they can compile spider to js while bundling.

nmn avatar Nov 19 '14 09:11 nmn

@naman34 Are you able to do that?

Namek avatar Nov 19 '14 10:11 Namek

@Namek I'm assuming that you're asking if I can work on these myself.

I've actually never written plug-ins for Browserify or Webpack myself, but they both fairly straightforward.. So I can look into it.

Before I do, I would need to know if Spider has any concept of modules yet, or has any plans.

nmn avatar Nov 28 '14 18:11 nmn

I guess we can already do:

  • spider --target es6
  • traceur --modules commonjs
  • browserify

or, alternatively:

  • spider --target es6
  • traceur --modules amd
  • use RequireJS

... although for my test project, Traceur is throwing "Unexpected token import" because the code is wrapped in an immediate function.

timdp avatar Nov 30 '14 15:11 timdp

hmmm.... I'll look into it.

nmn avatar Nov 30 '14 15:11 nmn

I've implemented a webpack loader reecer/spider-loader. I'm open to PRs.

reecer avatar Dec 01 '14 19:12 reecer