Generator: https://github.com/Swiip/generator-gulp-angular
On my recent projects I just pushed everything with git even the minified versions. But the dist/ folder is on the gitignore.
I read you shouldn't store minified etc. versions anyways in your git, because you don't need version tracking there.
This gulp plugin uses git: http://yeoman.io/learning/deployment.html
1) So do I push it via git and then build it again on my server with gulp build?
2) What is a good way to automate it? I would like to do s.th. like this:
gulp serve:dist Serve it on my localhost
gulp serve:server Push it to my server delete old version and build the new version there
No. What you should do is work locally with all your project and when you have to deploy the minified file, only run gulp build. The dist directory will be created and the only thing you have to do is to initialize git in here with git init and then add your server as remote.
You only have to re-run the build and push the content of your dist when you want to update it.
I don't think a simple thing as this is worth to optimize.
Related
I have started to learn Gulp.
It is nice, and now I have a dist folder, which is probably useless if I do not have a straight-forward method to put it on server.
Is there a way that Gulp will handle it for me, taking in concern to upload ONLY those files that modified or newly created? (In order to save upload time, sure).
I am working with Node.js.
Thanks.
how do you normally deploy to production? If you use ftp - there is a gulp function for that. If you use AWS S3 - there is a function for that. If you use something like docker or AWS EB, then you will continue to deploy through git etc - there is also likely to be a gulp function for this. Gulp is just a tool to process files and make build/deployment tasks easier.
Pulled straight from gulp website:
gulp is a toolkit for automating painful or time-consuming tasks in your development workflow, so you can stop messing around and build something.
I'm constantly working on new web development projects that don't ever, in practice, need their node_modules folder when deploying. It would suit me much more if I was just able to create a small gulpfile.js for each project, rather than 6000+ files contained in the node_modules folder for every project, that are only ever used by me on this machine.
I only use Gulp to compile SASS and prefix and minify my CSS. I don't need to worry about any other type of deployment issues, but the documentation says I need both: Global and local copies of Gulp.
Gulp needs to be installed locally, but you can link the local install to a global install:
npm install --global gulp
npm link gulp
See also https://stackoverflow.com/a/30742196/451480
Here is the Topeka app as it's found on Google App Engine Appspot.
Here is the (purported) Github index.html file.
Note: the app's source code is minified.
Question
Where is the un-minified source code for the Topeka app?
If it's the Github repository, then where (for example) is the file that's imported by <link rel="import" href="components/topeka-elements/topeka-app.html"> and the others in in lines 46-51 of index.html? I don't see any /contents/ directory in the repository.
If the source code is not the Github repository, where is it?
What's the deal with this minified build.js file, etc.? That's different from the customary index.html file. I haven't seen Polymer apps use that before.
Notes:
#bpowers says on 9-14-2015 in Polymer Slack Site:
it looks like they updated the build files a month ago, but its still old 0.5. I was able to build it by opening up a terminal and doing:
git clone https://github.com/Polymer/topeka && cd topeka && npm install && bower install && ./node_modules/vulcanize/bin/vulcanize -o build.html index.html --strip --inline --csp -- clone it, move into the dir, install the deps, and then run vulcanize. The vulcanize command is from the deploy.sh script in the repo.
if I run a web server in that directory, the build.html runs
That Github repo is the web application. The topeka elements are listed as a dependency in the bower.json - "topeka-elements": "Polymer/topeka-elements#^0.5.0"
Find the source here
Looks like they've checked in the vulcanized build output from the deployment - see deploy.sh
I'm creating a yeoman generator for my web projects.
But I wonder how I can try and test my changes before publishing it?
Since I have installed it once, it will not run my local development version, instead it runs my installed version.
Any suggestions on how can test-run my local development version?
I finally found some information on how to accomplish this:
if you wish to develop on the generators code base, and debug locally, a common way to do so is to rely on npm link
git clone the generators repo locally
cd into that repository and run npm link. It'll install required dependencies and install the package globally, using a symbolic link to your local version.
If you want to install sub generators, you need to do so in the context of a yeoman-generator package linked earlier. Cd into the sub generators package you have cloned locally and run npm link.
We now have everything linked and known on the system, we now need to link the sub-generator repo into the parent one, yeoman-generator cloned and linked in step 1 & 2.
https://github.com/yeoman/generator/wiki/Testing-generators
EDIT:
Updated link for info: https://yeoman.io/authoring/index.html
If by "running locally" you mean the ability to test your generator and its flow you can simply do this.
In your project directory folder run npm link. If this passes in flying colors, go to step 2.
Open a terminal and cd into the folder you wish to initiate a project.
Run yo generator-theNameOfYourGenerator. This will run your generator.
when you generate a yeoman project, do you commit the node_modules that is generated into your code repository?
It seems like it is necessary for another developer to check out a project and develop from it, but it seems like a lot of files to commit which seem unrelated to a project itself.
You can just run npm install to get the dependencies installed. However there are multiple benefits to committing your dependencies, which you can read about in this blog post:
Checking in front-end dependencies (for Bower, but applies to npm too)