Comments (8)
I don't understand... this module is using commonjs....
from cryptocompare.
Have a look... https://github.com/ExodusMovement/cryptocompare/blob/0.1.0/index.js
from cryptocompare.
Ah, I'm guessing you're referring to the usage of the enhanced object literals on the exports... this module exists to serve Exodus and if I commit to this small portion, that means I'll tie it to ES5. I can't do that when it's so easy to babelify these things. But it does work just fine in newer Node/commonjs versions (I forgot which version started supporting the new object literal syntax.. v5?) without Babel.
from cryptocompare.
I mean to write es5 commonjs
es6 modules don't work well with webpack/uglify config because as of yet, uglify still can not process new es6 like () =>
and ${var}
strings
from cryptocompare.
If you're delivering for Node.js/Electron, you don't need to uglify a 3rd party module. If you're delivering to the browser, you need to browserify/webpack anyways since it has module.exports
.
from cryptocompare.
Yes, I am delivering to a browser. My point is, your code does not work with uglify. I am sure I could switch to babili and I wouldn't have issues. But when it bundles everything into one minified js file for production, it errors, because uglify.js does not recognize the es6 code that is used in the index file.
Does that make sense?
I just mean it would be cool if you updated the npm package with something like requirejs
http://renderedtext.com/blog/2013/01/23/compile-requirejs-project-to-single-file/
from cryptocompare.
The easiest way I can think of to simplify the code though (install babel first):
babel index.js > out.js
This makes the file usable for everything.
from cryptocompare.
If you're delivering to the browser, you're using Webpack or Browserify, right? If so, drop in a Babel plugin in the pipeline before you Uglify and the problem is solved.
from cryptocompare.
Related Issues (20)
- Social HOT 4
- Will it support Web Socket? HOT 4
- Request throttling HOT 1
- How Do I Get Full Historical Data for One Coin? HOT 3
- ReferenceError: fetch is not defined HOT 2
- having trouble retrieving IOTA data HOT 1
- npm run build fails to minify HOT 2
- What is the api to get list of markets(exchanges)? HOT 1
- Not to get any method for getting historical prices of any currency within a range of timestamp or date
- List of FIAT currencies HOT 2
- No option for fiat currency amount to btc value HOT 3
- Fetching from '/coinsnapshotfullbyid/?id={id}' route fails with CORS error HOT 1
- Question: How to query via ES6 / React JS HOT 1
- iOS 9.x = Unexpected keyword 'const'. Const declarations are not supported in strict mode. HOT 2
- Add API_KEY to CI environment
- How to handle SBD* (Steem Dollars) and SCR* (Scorum) HOT 2
- Allow pass-through of result code to client.
- Example on calling an optional parameter HOT 1
- Is:cryptocompare/cosole.log(newsList)
- Typescript bindings HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cryptocompare.