I use grunt to package my webapp.
Grunt freezes at htmlmin stage. I guess it's because one of my html files is malformed. But how can I know which html file is the cause of the freeze?
Thanks.
Grunt has several options which can be utlized via the CLI.
--debug and --verbose may help to reveal the problem file.
They are used as follows when running grunt:
$ grunt --verbose --debug
...or when running a specific task. E.g.
$ grunt foobar --verbose --debug
(In the last example foobar would be replaced with the name of the task!)
Tip: Add a .html validation tool to your IDE to catch errors earlier in your workflow, or use an online validation tool. For example. validator.w3.org
Related
I can't figure out how to make a custom build for tom-select.js. In the gruntfile.js I see this:
// build tom-select.custom.js
/* this file is generated by grunt when calling `npm run build -- --plugins=<plugins> */
so should I just list the plugins in the command line after npm run build command with --plugins flag? What is the syntax for this? Thanks!
I just found the answer:
create /build/js/tom-select.custom.js
npm run build -- --plugins=remove_button,restore_on_backspace
I have UI project which is using GRUNT to perform build and tests. When I try to invoke tests within concourse task which resource image I should use where grunt is already installed. I am getting this below error now.
/bin/bash: line 4: grunt: command not found
You can use any OCI-compatible image that has grunt preinstalled. Alternatively, make your own image and push it to a repository like dockerhub. As yet another alternative you could use a base image for your task and install grunt every time (though this is slower).
TLDR: Concourse does not provide task images and you need to use your own.
I am trying to build a Meteor app using meteor build --directory ../dist. Everything seems to build fine, but when I follow the instructions provided in the generated README file I get an error saying the server/main.js file can't load. When I looked, I saw that the main.js file is not there.
Is there something I need to do before I build to ensure the file exists after build?
I'm having a very difficult time trying to build the Meteor app for a production serve, and I can't seem to find any clear instructions. The Meteor doc instructions are very vague in regard to build.
I can see how the README can be confusing if not followed as intended.
The first command line states:
$ (cd programs/server && npm install)
Note the parentheses.
Those cause the command to run in a subshell, which means that your shell will remain in the same directory after the command execution is done.
However, if you only execute the inner commands, you will end up in the programs/server directory and experience what you describe.
In any case, $ node main.js should be run from the bundle's root directory.
I've installed both the grunt-cli and grunt globally using the -g option.
However when I try and run grunt I get this error:
grunt --gruntfile /Users/a/root/config/Gruntfile.js
grunt-cli: The grunt command line interface. (v0.1.13)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
This is confusing as it seems to say that you are suppose to do a local install.
It seems contradictory actually. I clearly have a grunt file in place.
Grunt-cli is installed globally so that the grunt command is available to be run from any location on your system. Without the global installation, you would need to rely on somewhat abstract methods of running local grunt installs (npm run-script and friends), which are clunky for this use.
The entire point of the global install is only to load and run a local Gruntfile.js using the locally installed version of Grunt. The error message indicates this:
either a Gruntfile wasn't found or grunt hasn't been installed locally to your project.
In other words, to run Grunt, you need to create a Gruntfile.js and you must have a local copy of Grunt installed to your project alongside the file. The CLI is just there to kick off the process without troublesome fiddling.
Im using Ubuntu 13.04 (Linux)
I have installed node, and npm. With npm I downloaded less via terminal.
Im using this on my simple HTML/CSS project. pure frontend. its not a Ruby or nodejs project.
And when I do
lessc styles.less styles.css -x -w
in terminal, it compiles and compresses the code, but doesn't watch the file for changes, since Im expecting LESS to auto compile and refresh the page automatically. So, if I do any changes in my styles.less, every-time I have to go to terminal and enter the command to compile the less css.
Also, the compiler does NOT even show any compile errors even if I add anything on purpose, but in that case it doesn't compiles.
Please guide me on how to achieve the above. This is my first day with LESS CSS.
If you type lessc help you will see that there is no argument -w or --watch. What you can do is to use a build system like GruntJS with an extension like grunt-contrib-watch and have that monitor your less files and build the css on change.
I did this with help of #Oil on ubuntu forums.
In terminal,
1. install sudo apt-get install inotify-tools
then simply CD to the css folder.
and run below lines together:
while inotifywait -r styles.less; do
lessc -x styles.less styles.css;
done