Why does Rome think my file is empty when I try to compile it?

customcommander :

I'm trying out this new thing from Facebook called Rome

As it is still experimental, you need to first build this tool from source. I followed these steps without any issues.

In a nutshell, what I did was:

cd /tmp
git clone https://github.com/facebookexperimental/rome.git
cd rome
./scripts/build-release dist

I then installed it with:

cd /tmp
mkdir try-rome
cd try-rome/
npm install ../rome/dist/

That was all fine. I then created this file index.js with the following content:

alert("wat?")

And put an empty rome.json file at the root as per the "Getting Started" instructions at time of writing:

Rome requires a project configuration in order to operate. This can take three possible forms.

  • A rome.json file
  • A rome.rjson file (What is RJSON? See #13)
  • A rome field on package.json

This can just be an empty file. It's required in order for Rome to determine all the files in a project

And ran this command:

./node_modules/.bin/rome compile index.js 

Which failed with the following error:

enter image description here

I know this file isn't empty so why does Rome think it is?

V. Sambor :

In the documentation I saw this line:

$ echo '{}' >rome.json

It seems like the rome.json file should have at least an empty json {}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=301563&siteId=1