Giter Club home page Giter Club logo

Comments (14)

i-rocky avatar i-rocky commented on August 14, 2024

I'm not really a Node.js person, I always go with babel. But I thought when you import the module in any system, the systems configuration transpiles the script? Shouldn't the babel configuration of the repository be ignored or overwritten?

from country-list-js.

ekkis avatar ekkis commented on August 14, 2024

could we chat? are you on Telegram? I'm @ekkis there. or we could meet on IRC?

from country-list-js.

i-rocky avatar i-rocky commented on August 14, 2024

I have a class right now. I do have telegram but not using at this point. I'll install it when I get back.

from country-list-js.

ekkis avatar ekkis commented on August 14, 2024

ok. ping me when you have a bit of time

from country-list-js.

ekkis avatar ekkis commented on August 14, 2024

so, in fact, the only reason to run babel is for the tests. I've ripped it all out but not being a big browserify guy I'm having issues making the npm build work. it seems it's having a hard time minifying the code:

aprilis:country-list-js ekkis$ npm run-script build

> [email protected] build /Users/ekkis/dev/country-list-js
> gulp

[20:38:37] Using gulpfile ~/dev/country-list-js/gulpfile.js
[20:38:37] Starting 'watch'...
[20:38:37] Finished 'watch' after 11 ms
[20:38:37] Starting 'compile'...

events.js:174
      throw er; // Unhandled 'error' event
      ^
GulpUglifyError: unable to minify JavaScript
    at createError (/Users/ekkis/dev/country-list-js/node_modules/gulp-uglify/lib/create-error.js:5:14)
    at /Users/ekkis/dev/country-list-js/node_modules/gulp-uglify/lib/minify.js:56:15
    at DestroyableTransform._transform (/Users/ekkis/dev/country-list-js/node_modules/gulp-uglify/composer.js:12:19)
    at DestroyableTransform.Transform._read (/Users/ekkis/dev/country-list-js/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/Users/ekkis/dev/country-list-js/node_modul

in the gulpfile.js I took out line 2 let babel = require('babelify'); which didn't seem to be used anyway, and in the package.json I removed all the dependencies on babel stuff and the "browserify" section, which only seemed to address babelify. I also removed the .babelrc

help?

from country-list-js.

ekkis avatar ekkis commented on August 14, 2024

in fact, gulp-browserify has been retired so we should yank it anyway: https://github.com/deepak1556/gulp-browserify

from country-list-js.

ekkis avatar ekkis commented on August 14, 2024

ok, I figured out why it won't minify... uglify doesn't support => functions. grr... the suggested solution is to babelise but since we're trying to get rid of babel, I'm going to have to convert all that pretty ES6 to old style :(

from country-list-js.

i-rocky avatar i-rocky commented on August 14, 2024

Got a class break. Aren't we supposed to write CommonJS/ES5 for npm packages? I wrote a package in ES6 and now it has to be explicitly mentioned in webpack configuration to be compiled.
https://github.com/themexpert/react-filemanager

from country-list-js.

ekkis avatar ekkis commented on August 14, 2024

I write for node in ES6. the trouble with this particular package is the need for web support where it has to be browserified. the minifier (uglify) doesn't know what to to with ES6

from country-list-js.

ekkis avatar ekkis commented on August 14, 2024

what timezone are you in?

from country-list-js.

ekkis avatar ekkis commented on August 14, 2024

I'd love to be able to keep the ES6, but with uglify installed:

$ echo "var x = () => null;" > t.js
$ uglifyjs t.js

and I get:

Parse error at t.js:1,9
var x = () => null;
^
ERROR: Unexpected token: punc ยซ)ยป
at JS_Parse_Error.get (eval at (/Users/ekkis/.nvm/versions/node/v11.5.0/lib/node_modules/uglify-js/tools/node.js:20:1), :71:23)
at fatal (/Users/ekkis/.nvm/versions/node/v11.5.0/lib/node_modules/uglify-js/bin/uglifyjs:296:53)
at run (/Users/ekkis/.nvm/versions/node/v11.5.0/lib/node_modules/uglify-js/bin/uglifyjs:240:9)
at Object. (/Users/ekkis/.nvm/versions/node/v11.5.0/lib/node_modules/uglify-js/bin/uglifyjs:165:5)
at Module._compile (internal/modules/cjs/loader.js:721:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)

so it obviously doesn't know what to do with it

from country-list-js.

ekkis avatar ekkis commented on August 14, 2024

ok. I found the more modern gulp-uglify-es so I've rewritten the gulp file. I get to keep my ES6 - yea! and we get to keep support for the browser. see pull request

from country-list-js.

i-rocky avatar i-rocky commented on August 14, 2024

GitHub giving me notification about possible vulnerability of some package that are dependency of the devDependencies used in this package. How am I supposed to fix that!

from country-list-js.

ekkis avatar ekkis commented on August 14, 2024

a vulnerability in devDependencies does not affect users of the package, only the package builder, so don't worry about it. there are many packages out there that need fixing

from country-list-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.