I
I
Ivan Palamarchuk2018-09-19 16:32:23
JavaScript
Ivan Palamarchuk, 2018-09-19 16:32:23

Why doesn't babel-cli translate es-2015 - es-2018 to es5?

Hello, the project has a task to rewrite small libraries from ES5 to ES-2015/18. I would like to do this with some kind of console commands (to automate the publishing process), but the launch npx babel ./path/to/file.jsdoes not lead to anything, more precisely, it does, but I still see and . I understand that the question is very simple for many, but on my way I bypassed node.js, unfortunately. And time is running out, so I'm asking a question here. class { /* что-то там */ }() => {}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladlen Hellsite, 2018-09-20
@delef

Rollup build https://medium.com/@kelin2025/so-you-wanna-use-es6...
Use "prepare" in scripts to run build from src to lib for example.

{
    "name": "you-library",
    "scripts": {
        "prepare": "babel src -d lib"
    }
}

A
Alexey Bille, 2018-09-19
@alexey_bille

https://habr.com/post/112530/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question