I keep seeing the recommendation for making JS files ready for production to be concat then uglify.
For example here, in on of Yeoman's grunt tasks.
By default the flow is: concat -> uglifyjs.
Considering UglifyJS can do both concatenation and…
I use concat to merge JS files into one file and uglify to minimize the JavaScript. How can I create a sourcemaps file that uses the source JS files?
My current gruntfile:
concat: {
options: {
// define a string to put between each file…
I have an Angular project with potentially many modules. Each module has it's own directory with subdirectories for controllers, directives, services, etc. Something like this:
src
|-- js
|-- modules
|-- moduleOne
|…
Before I ask this question I want to point out that there are several similar questions posted here on StackOverflow, but none of them provide an accurate solution to the problem.
The problem
I have a workflow setup where Grunt combines and…
Why do I get the error below? My grunt version is > v0.4.0
npm install grunt-contrib-concat --save-dev
+-- UNMET PEER DEPENDENCY grunt@>=0.4.0
Error messages:
..Projects\Hartz\Hartz>npm install grunt-contrib-concat --save-dev
Hartz@1.0.0…
I am trying, using grunt and babel, to transpile all js6 files in a folder and end up with a concatenated single file (js5) with a working sourcemap to the original es6 files. However the sourcemapping does not work. My babel, concat settings…
I need to be able to run multiple tasks of the same type of task within Grunt (grunt-contrib-concat). I've tried a couple of things below but neither work. Any ideas on how to do this are appreciated.
concat: {
dist: {
src: [
…
I'm using grunt-contrib's concat and uglify modules to process some javascript. Currently if src/js/ is empty, they will still create an (empty) concat'd file, along with the minified version and a source map.
I want to task to detect if the…
I am writing a Gruntjs script which should
concatenate + replace template of some JS files into target directory (contrib-concat)
copies + replace template of some other files (contrib-copy)
package the files into a zip file
contrib-concat has a…
I love using Grunt for concatenating and minifying plugins etc.. can someone please tell me how to do this task on Angular 2's node_modules.. i want to end up with 1 file that is minified and concatenated.. I have tried webpack etc and gulp…
Working on putting together a base Gruntfile.js for some upcoming projects. Starting in on a new computer so everything has been a fresh build. Installed Node and NPM using Homebrew, and then installed Grunt globally, as well as in my local…
After migrating to El Capitan, it seems users are experiencing an issue with grunt installations, possibly related to the rootless changes of El Capitan. In particular, running the grunt --force command results in EPERM errors. The workflow is as…
I am new to grunt (literally installed it today and using it) and its great, but i cannot work out something.
I have an angularJs project and i would like to concat all my javascript files into 3 files overall.
So i would have
"base" - all the…
I have just started using grunt and I want it to use combine all files and uglify them.
But my issues is that it combines and uglifys, but it doesn't remove import statements. (I'm using uglify and concat)
What I want -
// File.js
import something…
I am having an issue trying to get my Grunt.js file to work. Currently I have it set up to just concatenate all my php function files, and decided since a lot of my work projects use Bootstrap, to concatenate only the javascript files I'll be using.…