Questions tagged [babel-cli]

61 questions
1
vote
4 answers

Babel-CLI set config value correctly

I am trying to add a build command that uses babel CLI to transpile my ES6. I am having difficult pointing it correctly to babelrc. The file structure is roughly as follows: root src index.js ... .babelrc …
tim-mccurrach
  • 6,395
  • 4
  • 23
  • 41
1
vote
0 answers

babel.config.js vs .babelrc (Vue + Express in same directory)

You can directly skip to the last part of this section for the exact questions? For full context, read from the start. This is how I initiated my Vue project: vue create awesome-frontend choose all defaults and ended up with babel.config.js file in…
saibbyweb
  • 2,864
  • 2
  • 27
  • 48
1
vote
1 answer

babel [...] --watch not working for building an es6 folder every time there is a change

I am creating a simple component library and would like to have it built every time I save one of my files. This is what my current command looks like: "watch": "babel components/ --out-dir dist --copy-files --ignore test.js --watch" I have also…
theJuls
  • 6,788
  • 14
  • 73
  • 160
1
vote
0 answers

Is it possible to use cache between @babel/cli runs?

When re-running babel from the terminal on a group of files which is largely unchanged, babel takes the same amount of time to process them. Is there a way to use caching between different runs of babel to speed things up?
aryzing
  • 4,982
  • 7
  • 39
  • 42
1
vote
0 answers

How to get the name of file that triggerred nodemon restart?

I have some JSX files in my src directory. I use babel cli to compile them and nodemon to watch for changes in these files. nodemon --watch src --exec "npx babel src -d bin" However, at each restart all the files in src are compiled even though…
ranjan_purbey
  • 421
  • 4
  • 11
1
vote
1 answer

Babel with .babelrc how to fix MODULE_NOT_FOUND?

Babel is telling me a plugin does not exist when it does. (I can compile fine with babel-cli, but that does not support setting pragma options. So I am left to use disgusting .babelrc file) What am I doing wrong here ? .babelrc { "plugins": [ …
Robert C. Holland
  • 1,651
  • 4
  • 24
  • 57
1
vote
0 answers

How to use ReactJs with just Babel without webpack or other blunderer?

I am trying to create an environment for ReactJs using just babel and its presets and plugins. So far I can render my React component using transform-react-jsx plugin. But I can't add CSS to it. How do I do it? ` { "presets": ["es2015",…
Subhendu Kundu
  • 3,618
  • 6
  • 26
  • 57
1
vote
1 answer

"Unexpected token {" when using npx babel-node

Here is my script test.js: import 'jsdom-global/register'; import 'canvas'; console.log('done'); And here is my package.json: { "name": "test-jsdom", "description": "Test", "version": "0.1.0", "author": "anthony@me.com", "dependencies":…
Anthony Kong
  • 37,791
  • 46
  • 172
  • 304
1
vote
0 answers

Transform two es6 modules into one file with babel

I have files a.js and main.js: a.js: export default A = 7; main.js: import A from './a' console.log(A); I want somehow process that files to get one result file (let say result.js), which I can add into html page (via
diralik
  • 6,391
  • 3
  • 28
  • 52
1
vote
0 answers

Babeljs, please Do not ignore my package

I would like to have babel transpile my package from within node-modules. I've read a few issues already of people trying this, but right now it seems it is broken again. It would be good to see if other agreee, or if I am doing something…
peter.mouland
  • 1,893
  • 17
  • 30
1
vote
1 answer

Babel CLI ignores configuration when input is piped

This might be a bug in Babel CLI (I'm using 6.24.1), but it appears that Babel doesn't apply .babelrc when the source data is being piped to it. Example: Given this source file, foo.js: const foo = 10; Good: This command does what you think it…
Sean Werkema
  • 5,810
  • 2
  • 38
  • 42
0
votes
2 answers

babel-node --presets node '.' is not recognized as an internal or external command,

this is the dependencies in package.json { "name": "whatsapp", "version": "1.0.0", "description": "whatsapp-clone-in-mern-stack", "main": "server.js", "scripts": { "start": "./node_modules/babel-cli/bin/babel-node.js --presets node8…
Krishnadev. V
  • 345
  • 2
  • 8
  • 23
0
votes
1 answer

How to set the extension and path for the output file in JetBrains File Watcher with Babel? [Linux]

I am trying to set up PhpStorm to work with Babel instead of UglifyJS. I need the minifed output file to be written with a different extension to the same directory where the source script is located. I changed argument line in the File Watchers…
Kembrick
  • 1
  • 3
0
votes
1 answer

How to change babel output file extensions?

As the title says, babel --out-file-extension doesn't work. Here is package.json : { "name": "Assets", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", …
Hooman Limouee
  • 1,143
  • 2
  • 21
  • 43
0
votes
2 answers

How to use babel-cli directory paths?

EDIT: Answered, below. Also: If you are reading this you are probably new to web dev and you should consider using webpack for this instead of babel alone I have what seems like a very simple problem but I can't solve it. I have a directory…
Paul Wilson
  • 562
  • 5
  • 16