pjax icon indicating copy to clipboard operation
pjax copied to clipboard

Convert code to ES6 and add a transpile build step

Open BehindTheMath opened this issue 7 years ago • 10 comments

As mentioned here, I think this should wait until we finish fixing all the existing issues, so we don't cause any conflicts.

BehindTheMath avatar Jan 19 '18 06:01 BehindTheMath

This sounds sensible, if this still ends up using Browserify with the addition of the Babelify transform, you could add the following topackage.json to allow people bundling the npm package through Browserify (my usage) to get transpiled output as well (Browserify won't transform anything under node_modules by default):

{
  "browserify": {
    "transform": ["babelify"]
  }
}

robinnorth avatar Jan 19 '18 10:01 robinnorth

Another possibility is to include in npm package compiled files (but ignore those in git).

MoOx avatar Jan 22 '18 07:01 MoOx

Webpack?

phifa avatar Feb 06 '18 08:02 phifa

@phifa I believe Webpack is overkill for a library like Pjax. Webpack is more suited for a webapp with different types of assets or multiple entry points. For Pjax, Babel and Browserify should be fine.

BehindTheMath avatar Feb 07 '18 14:02 BehindTheMath

Rollup should be a good candidate.

MoOx avatar Feb 07 '18 14:02 MoOx

Do we even need Rollup?

BehindTheMath avatar Feb 07 '18 14:02 BehindTheMath

I just know that Rollup is nice for library authors

MoOx avatar Feb 07 '18 14:02 MoOx

True. I'll have to look into the differences between Rollup and Browserify.

BehindTheMath avatar Feb 07 '18 14:02 BehindTheMath

@MoOx What browserlist settings do you think we should use for Babel?

BehindTheMath avatar Mar 03 '19 17:03 BehindTheMath

No idea what is best to use. Keep defaults?

MoOx avatar Mar 04 '19 06:03 MoOx