Questions tagged [grunt-contrib-concat]

Concatenate many files into one

Grunt task to concatenate many files into one

174 questions
3
votes
2 answers

Grunt outputs an empty .js-file after concatting

The output of the Gruntfile is an empty file in public/assets/app.js. The Sass-part works fine, but the JS-part doesn't. //Gruntfile module.exports = function(grunt) { //Initializing the configuration object grunt.initConfig({ // Task…
user1469734
  • 851
  • 14
  • 50
  • 81
2
votes
1 answer

How do I create a sourcemap for each individual js file with grunt-contrib-concat and grunt-contrib-uglify?

Currently, the concat and uglify settings are: concat: { options: { // options }, angular: { src: ['public/**/*.js', '!public/**/*.min.js', '!public/lib/**/*.js'], dest: 'build/_main.js', } }, uglify: { options: { mangle:…
2
votes
1 answer

How to make couple of minified files from different js files using grunt

I am new to grunt and task runners in JS, so this might seem a simple question but I have been unable to find exact working answer. I have : concat: { options: { // define a string to put between each file in the…
Saurabh Tiwari
  • 4,632
  • 9
  • 42
  • 82
2
votes
0 answers

Code minification of angular app using grunt concat and uglify

I'm using grunt concat and uglify to minify angular app however the minified script is giving the following error. Uncaught Error: [$injector:modulerr] …
2
votes
1 answer

Grunt concat multiple JSON files

I have multiple JSON files, each located in different paths. Now I'm trying to concat all files with "grunt-concat-json". The source JSON files are looking like this: ExampleA.json [ { "configPath": "Example A" } ] ExampleB.json [ { …
2
votes
1 answer

Grunt.js: Replace path when concat multiple CSS files from different directories

I'm trying to minify and combine multiple CSS files using Grunt.js concat and cssmin from different directories. Unfortunately, css breaks since each CSS has relative link to resources, for example: background-image: url('images/background.jpg'); I…
2
votes
1 answer

JavaScript Module pattern files concatenation in a one file and using their functions

I write different files under JavaScript Module Patern like this: file 1.js var Module = (function (module) { module.function = function () { console.log(this.thirdFunction) // This is my issue. I cannot access the function from the third…
2
votes
0 answers

Glob pattern excluding some of the first level directories

I have a folder structure like this ProjectX .......|_____node_modules .......|_____src .......|_____build .......|_____app .......|_____libraries I have written a glob pattern in grunt browserify something like…
ghousuddin
  • 21
  • 2
2
votes
1 answer

Grunt Warning: Task "concat" not found

I'm trying to get started with a simple Grunt example, but I'm running into an issue with grunt-contrib-concat. Here's my Gruntfile.js: $ cat Gruntfile.js module.exports = function(grunt) { grunt.initConfig({ pkg:…
Jonathan.Brink
  • 23,757
  • 20
  • 73
  • 115
2
votes
0 answers

grunt-contrib-concat concat goal sourcemap option is not working (windows)

When running grunt concat the console says my source map is created, but the source map is not present on my file system. My plugin configuration in my Gruntfile: grunt.config('concat',{ scripts: { src: [ …
geography_guy
  • 331
  • 1
  • 4
  • 12
2
votes
1 answer

Best way of concatenating or merging files in node.js

So i've been searching for the best way of concatenate n (log) files in node.js The final file cannot be more than 100MB, if there is more, i should create an other one and so on. I have some different approaches: Use grunt and grunt and…
R01010010
  • 5,670
  • 11
  • 47
  • 77
2
votes
2 answers

How to add a build timestamp at the end of the minified files

I have a real issue now, When I'm on Production and when ever I update my CSS or JS the same file keeps on serving from the server.. I i need to get the new updates then I have to hard refresh the browser, I'm thinking of having a way to add a build…
Sahan
  • 1,422
  • 2
  • 18
  • 33
2
votes
2 answers

What's the best way to concatenate vendor js files?

In my Angular JS app, I'm using a lot of third party packages, mainly maintained via Bower. When I use Grunt to concatenate all of them into one mega file, I'm getting errors when I load my page, for example that Uncaught ReferenceError: angular…
CodyBugstein
  • 21,984
  • 61
  • 207
  • 363
2
votes
2 answers

How to grunt concat in a wrapping function

I have three files containing js classes: A.js B.js C.js I'm trying to concatenate them to get something like: var Module = (function (scope) { // content of concatenation (ABC.js) })(scope); For now I'm using…
FXG
  • 1,308
  • 1
  • 12
  • 21
2
votes
1 answer

Grunt Does Not Watch JS files

I have been spending over an hour on this one, looked through several questions, but the answer is nowhere to be found. I am running into a problem when using watch on my javascript files. All of the other files are watched and the tasks are…
1 2
3
11 12