grunt-contrib-concat

Replace all the text with specified replacement using grunt replace

為{幸葍}努か 提交于 2019-11-28 11:55:38
问题 I have a .html file which contains id="fixedtext", I want to replace all these id with id="uniquetext" the grunt-text-replace just replaces the first id it finds and doesnot parse the entire text. Any idea how can I make either grunt-text-replace https://github.com/yoniholmes/grunt-text-replace or grunt-replace https://www.npmjs.com/package/grunt-replace to do this for the entire document and not just for the first occurrence. replace: { dist: { options:{ patterns:[{ match:'id="fixedtext"',

ENOTSUP using Grunt

限于喜欢 提交于 2019-11-28 08:26:41
问题 I'm using Grunt to minify and concatenate files for an AngularJS web application. Our source is on a file share and I'm connecting to it via a mapped drive. Whenever Grunt runs over my source directory, I get an error on one of my concat tasks. The error is "ENOTSUP, operation not supported on socket". If I copy the source, local, Grunt runs, fine. For the sake of our source control, I need Grunt to watch and run over the mapped drive. The concat task uses grunt-contrib-concat. I've tried

Using grunt to concat many files from many dirs into single renamed file in new directory

风格不统一 提交于 2019-11-27 20:09:04
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 | module.js |-- controllers | listController.js | detailController.js |-- directives | listItem.js | summaryWidget.js |-- filters |-- services | moduleService.js My build essentially bundles and compiles files from src/ and puts into dev/, then minifies the files in dev/ and moves into prod/. During dev, the server points to the dev/ folder and in production, the server points to the

Grunt concat + uglify with sourcemaps

你。 提交于 2019-11-27 10:30:10
问题 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 in the concatenated output separator: ';' }, dist: { // the files to concatenate src: ['<%= config.src %>/js/**/*.js'], // the location of the resulting JS file dest: '<%= config.dist %>/js/main.js' } }, uglify: { dist: { files: { '<%= config.dist %>/js/main

Why is it recommended to use concat then uglify when the latter can do both?

时光总嘲笑我的痴心妄想 提交于 2019-11-27 09:45:16
问题 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 minification, why would you ever need both at the same time? Thanks. 回答1: Running a basic test to see if there is a performance difference between executing concat and then uglify vs. just uglify . package.json { "name": "grunt-concat-vs-uglify",

Using grunt to concat many files from many dirs into single renamed file in new directory

孤人 提交于 2019-11-26 22:53:50
问题 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 | module.js |-- controllers | listController.js | detailController.js |-- directives | listItem.js | summaryWidget.js |-- filters |-- services | moduleService.js My build essentially bundles and compiles files from src/ and puts into dev/, then minifies the files in dev/ and moves