kornelski / http-cache-semantics

RFC 7234 in JavaScript. Parses HTTP headers to correctly compute cacheability of responses, even in complex cases
http://httpwg.org/specs/rfc7234.html
BSD 2-Clause "Simplified" License
244 stars 27 forks source link

Version 3.8.0 throws error in npm run build #6

Closed Peak7Solutions closed 6 years ago

Peak7Solutions commented 6 years ago

using reference: "http-cache-semantics": "3.8.0", causes the following error: image

ERROR in bundle.js from UglifyJs SyntaxError: Unexpected character '`' [./~/http-cache-semantics/node4/index.js:279,0] [13:41:33] Finished 'buildWebpack' after 39 s [13:41:33] Finished 'html' after 40 s

kornelski commented 6 years ago

The code is for Node 4 and later, which means it requires ES6 and will not work with ES5-only tools.

You probably need either https://www.npmjs.com/package/uglify-es or Babel to convert it to the old JS for Uglify first.