Gulp Watch does not work on Windows Subsystem for Linux 2 (WSL 2) - gulp

I am working on a project on WSL 2 in windows. The project uses node to only compile sass and minify js. I have saved the project files on my Windows File System. I access the project files and run the project using Ubuntu on WSL 2. Everything works fine except gulp watch. I use VSCode as text editor. I have configured gulp watch properly to recompile sass files on changes but it does not seem to do that. On running the gulp watch, watch starts but on making any change, the SASS files are not compiled.

This is because of the way WSL 2 works. File changes made by Windows apps on Windows filesystem don't trigger notifications for Linux apps. This issue is currently open on GitHub at this link.
To make it work, store your project files in the home directory on Linux filesystem (cd ~ will take you to home directory). Run gulp watch again and you should be good to go !!!

Related

Bitbucket Pipelines case-sensitive filesystem

Tech: gulp, polymer-build, bitbucket pipelines
I have a build step as part of a project which copies a bunch of bower_components files into the /dist folder. When run locally this works fine. However when running the same script on Bitbucket, it fails when reaching the module Chart.js
Error: ENOENT: no such file or directory, open '/opt/atlassian/pipelines/agent/build/bower_components/Chart.js/dist/Chart.min.js'
I believe the module cannot be found because of the capital 'C'. Since pipelines runs docker, is it possible to ensure that the filesystem is case-insensitive?
The build task is run with gulp and polymer-build, but I cannot find anything around case-insensitive copying or piping, and since the task runs fine on a mac. I believe it is an issue with the environment. Has anyone come across similar issues with the filesystem?

Polymer CLI not creating bower_components folder on Windows 7

I installed node, bower and the polymer cli on a Windows 7 machine.
If I choose the "polymer-2-element" option and then defaults for the rest of the questions, the CLI builds a project but there is no bower_components folder created in the project. There are no bower errors as it downloads files. It is putting the files in the AppData\Local\bower\cache folder.
If I run the app with "polymer serve --open", the browser console shows 404's for anything in the bower_components folder.
Any ideas?

hot reload in jekyll not working

I've installed jekyll 3.1.6 on Mint 17 (ubuntu 14.4) with
ruby 2.2 + python 2.7
My browsers are Chromium and Firefox
I think I've tried every trick I can find on the internet, but it still won't auto-reload, even though the terminal does say that auto-regeneration has been enabled and with each file content change and save, the terminal logs the change and tells me it's been done. But I'm still forced to refresh a page manually to see the changes.
Open to any and all suggestions.
Jekyll auto-generation future(Using jekyll server) automatically change/modify the files on _site folder only, it does not refresh browser windows automatically, you have to use grunt for that. There are already many of NPM packages and Repo for that.

Can I install just Gulp globally?

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

Testing yeoman generator locally

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.