Comments (6)
Hello. gulp is installed globally, but if you are using it in projects that your co-workers will be building on also, a good way to define that dependency is to define it in the devDependencies
section of your package.json. This way, everyone knows what dev tools are necessary and it will be installed on calling npm install
.
https://www.npmjs.org/doc/files/package.json.html#devdependencies
Also, it technically doesn't matter if you run gulp from within scotch-box or from your local machine. The results will be pretty much the same since your local files are mirrored with the ones on the VM.
from scotch-box.
Of course. If we commit the node_modules
we would not even have to npm install
(although, generally I don't like adding node_modules
to git).
But that does assume a co-worker would have npm and gulp etc. installed locally—if a she does not have npm/gulp installed locally—she would have to run npm install
in the guest machine and run gulp from there. Conversely, running locally would require one to use e.g. the browser-sync --proxy
, right?
I'm mentioning this because I need to write some simple instructions/documentation for a team of front-end developers and I am thinking of the most robust approach.
Also I do wonder if there could be changes between local gulp
\ node
or the one in scotch-box since, theoretically, versions could be different (also: different OSes)
Anyway, thanks for the quick reply.
from scotch-box.
The node_modules
should be added to the .gitignore
file. It's the accepted best practice since the versions are dictated by the package.json
file so you wouldn't have version conflicts.
Instructions then would be:
- Install node and npm
- Install gulp globally:
npm install -g gulp
- Clone the repository
- Install project dependencies:
npm install
- Start the project by running gulp:
gulp
I don't think you would need to use browser-sync --proxy. scotch-box uses shared folders so she wouldn't need to even ssh into it. You can run gulp
locally and that would be much easier to provide instructions for than sshing into the VM.
from scotch-box.
@sevilayha Thanks Chris.
I am thinking about removing the need for 1) & 2) (which would probably require slightly different 4) & 5) :-) ). This way the Vagrant box would contain all the necessary tools.
PS: normally I would indeed add node_modules
to the .gitignore
.
Thanks for taking the time to reply, I think the common steps you describe should be manageable for most ;-)
from scotch-box.
Glad I could help. I can understand having all the encompassed tools within the box, but it is also important to note that it would be another good approach to have the project itself contain the necessary tools (by naming them and their versions in the package.json
).
You never know if you will change up your environment in the future and it could break this current project. Having dependencies project based instead of box based gives you more flexibility moving into the future.
from scotch-box.
👍 🍻
from scotch-box.
Related Issues (20)
- PHP Version with Pro
- Guest additions version outdated/incompatible HOT 3
- Can we get scotch.io to a LTS dist?
- SB 3.5 shows default home page for every project HOT 2
- Vagrant Up - Unable To Fetch HOT 2
- There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below. HOT 1
- Laravel mix not working by default HOT 1
- Ubuntu 17.10 is EOL, and provisioning new box now fails as a result HOT 7
- Error with Craft CMS on Installation
- 38456 HOT 1
- Vagrant up not working HOT 1
- Vagrant up not working (MacOS) HOT 1
- Scotch Box 3.5 not running on macOS Catalina HOT 2
- Uncaught Error: Class 'PDO' not found HOT 1
- 403 Forbidden error when using NFS on MacOS Catalina HOT 1
- Invalid link HOT 1
- For NodeJS apps: nodemon doesn't work HOT 1
- PHP 5.6 is installed by default on the free version HOT 2
- the php version need be update to 7.4 HOT 1
- vagrant up error: HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scotch-box.