I've configured some grunt tasks (concat/uglify) that generates minified files in my project. These tasks are triggered with the File Watcher plugin that comes with PHPStorm.
I've also configured automatic deployment, but that does not work for files that have been generated by grunt tasks.
I thought this would be handled by the "Output paths to refresh" option in the File Watcher (where I specified the full path to the minified file), but this does not trigger the automatic deploy.
Have I forgotten something? Please help.
Related
I am developing a new moodle plugin. But when I run grunt in my plugin folder
grunt amd.
directory structure
local->webcam->amd
amd has two folder build and src and my file is in src folder
I am getting following error
PS C:\xampp\htdocs\moodle\local\webcam> grunt amd
Running "ignorefiles" task
Running "eslint:amd" (eslint) task
Could not find any files to validate
I have no idea why it is not detecting my file.
My node version is correct and everything but grunt is not detecting my file
I'm trying to use the File Watcher tool in the Jetbrains IDE (Webstorm and Rider) to automatically minify my .css files and generate .min.css files for them on the whole project.
Thing is, it keeps minifying files that already have .min.css as the extension. So I end up with files like slick.min.min.css. I can't find any option to control what the criteria is for matching files. Is there some option to force it to ignore .min.css files, so I don't get duplicates?
I was following this guide here: https://www.jetbrains.com/help/idea/compressing-css.html#ws_css_compress_create_file_watcher
with some tips from here How to Minify CSS with SCSS File Watcher in PHPStorm IDE
As .min.css files are still CSS files, your watcher listens to changes in all them ( because watcher Scope == Project files, File type == CSS) and produces the output.
As a workaround I can suggest excluding minified files from watchers processing:
create a new scope (Settings | Appearance & Behavior | Scopes) with minified files excluded (like file:.css&&!file:*.min.css)
choose this scope as your file watcher Scope
I'm using grunt with the grunt-eslint plugin. This is part of a larger grunt task that first finds changed files and does various tasks with them. If there aren't any JS files changed (for example if I just change a CSS file) the whole task aborts because eslint fails with a "could not find any files to validate" message.
$ grunt eslint:precommit
Running "eslint:precommit" (eslint) task
Could not find any files to validate.
Warning: Task "eslint:precommit" failed. Use --force to continue.
Aborted due to warnings.
I don't want the task to fail if there aren't any JS files found.
Is there a way to either:
A. Have the grunt task not even call eslint and not fail if no files are run?
B. Have eslint not fail if no files are run?
(Related, but specific to a different tool called from grunt: Can an assemble target be silenced if there are no matching files? (Without using --force))
Using Dynamic task is your solution, here the link for the docs: http://gruntjs.com/frequently-asked-questions#dynamic-alias-tasks
Related links:
How can I skip a grunt task if a directory is empty
I am completely new to all this, 'Bower' and 'Gulp' and Laravel 'Elixir'. I purchased a template that uses them (unfortunately) and now I need some help on how to go about implementing them. I have already installed NPM and Bower. All my packages have been downloaded into:
resources > assets > vendor
This is a screenshot:
Now my question is how do I include all those packages I downloaded in my view? From my understanding I can't run less files directly in the browser, it only runs once due to 'browser caching' or something like that, also the JS scripts are just too many to include in my page.
I want a way where I can work on my files and have them automatically compiled with the compiled files being referenced in my app.php file.
This is a link to the GulpJS file included in my template: http://pastebin.com/3PSN6NZY
You do not need to compile every time someone visits. The compiled sass/js should be run in dev and then the output files referenced.
If you have gulp installed on the project, you should see a gulp.js file in the root of your project. If not, visit here for instructions:
Gulp/Elixer installation and setup
In your gulp.js file:
var elixir = require('laravel-elixir');
elixir(function(mix) {
mix.less([
'app.less',
'normalize.less',
'some-other-less.less',
'and-another.less'
]);
mix.scripts(['app.js', 'some-other-js.js'], 'public/js/output-file.js');
});
While in development you can run gulp watch from the command line to listen for changes and run compile tasks when it hears a change. Then you simply reference the output files in the public directory as you normally would.
If you don't want to listen, you can just run the gulp command for a single once-off task run.
The docs are pretty straight forward and can be found here:
Gulp/Elixer docs
I want to run grunt on several projects simultaneously. However i'm not sure how to setup so it works. Here's what my setup looks like:
- Project 1 folder
-[project files]
-Gruntfile
- Project 2 folder
-[project files]
-Gruntfile
- Grunt Folder
-[nodeModules]
-package.json
So the idea is that have all grunt dependencies (node modules) in a single centralised folder. Then each project folder has its own Gruntfile.
The problem I have is that I don't know how to setup the gruntFile so that it can use the node modules and package.json from the grunt dependancy folder.
Can anyone help me with how I can get this to work? Specifically with code examples.