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