I am wondering how to configure my package.json with Parcel so it can watch multiple folders, here is the JSON I have so far:
{
"name": "ProjectName",
"private": true,
"version": "0.1.0",
"description": "Example for Parcel",
"main": "server.js",
"scripts": {
"dev": "concurrently \"npx nodemon server.js -e js,hbs,json,\" \"npx parcel watch ./folder_for_first_bundle/index.js -d ./public/js/build/\" ",
"second": "concurrently \"npx nodemon server.js -e js,hbs,json,\" \"npx parcel watch ./folder_for_second_bundle/index.js -d ./public/js/build/\" ",
"build": "npx parcel build ./folder_for_first_bundle/index.js -d ./public/js/build",
"secondBuild": "concurrently \"npx nodemon server.js -e js,hbs,json,\" \"npx parcel watch ./folder_for_second_bundle/index.js -d ./public/js/build\ -o second_bundle.js" ",
"start": "npm run dev"
},
"license": "BSD-3-Clause",
"devDependencies": {
"concurrently": "^5.2.0",
"nodemon": "^2.0.3",
"parcel-bundler": "^1.12.4"
},
"dependencies": {
"dotenv": "^8.2.0",
"express": "^4.17.1",
"hbs": "^4.1.1",
"lodash": "^4.17.15",
"mysql": "^2.18.1",
"vhost": "^3.0.2"
}
}
If I run npm run second
in command line, it starts the server fine, and seems to be getting files from that folder. However, no bundle is created. I guess I could point each bundle to their own folder, but that seems like that optimal…
Also, I am not sure where to put the option to remove console logging. So 2 questions in this thread.
Thanks for any help!