Here is how my package.json is structured:
{
"name": "project",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"lint": "./node_modules/eslint/bin/eslint.js --format \"./node_modules/eslint-friendly-formatter/index.js\" .",
"build:server": "./node_modules/babel-cli/bin/babel.js . -d dist/server --ignore node_modules,dist,client,public,webpack*"
}
}
The commands lint
and build:server
in the script section above are quite hard to read, so I am considering breaking them into multiple lines.
I attempted using \
, but it resulted in errors like this:
npm ERR! Failed to parse json
npm ERR! Unexpected token ' ' at 11:80
npm ERR! :server": "./node_modules/babel-cli/bin/babel.js . -d dist/server \
npm ERR! ^
Is there a way for me to achieve this without errors? Or should I create another bash file such as build.sh
and call it in npm scripts with ./build.sh server
?