Working project structure that uses grunt.js to combine JavaScript files using RequireJS?

I use the grunt-contrib-requirejs task to build project based on require.js. Install it inside your project directory with: npm install grunt-contrib-requirejs –save-dev BTW: –save-dev will add the package to your development dependencies in your package.json. If you’re not using a package.json in your project, ignore it. Load the task in your grunt file with: grunt.loadNpmTasks(‘grunt-contrib-requirejs’); … Read more

Why does Grunt not add itself to the shell?

Since Grunt version 0.4 (which was released 1 or 2 weeks ago) you need to install the grunt command line tool globally (if needed, use sudo before the command): npm install -g grunt-cli In your project location you then install the latest grunt version: npm install grunt –save-dev Option –save-dev will save the npm config … Read more

What is workflow in Yeoman to work with Sass files?

What you are looking for is documented on: https://github.com/yeoman/grunt-usemin Simply wrap your css imports in a comment block similarly to the way it’s done with the javascript files <!– build:css styles/main.css –> <link rel=”stylesheet” href=”https://stackoverflow.com/questions/15617431/styles/base.css”> <link rel=”stylesheet” href=”styles/modules.css”> <link rel=”stylesheet” href=”styles/layout.css”> <!– endbuild –> make sure your generator is up to date and your grunt … Read more

Configure grunt copy task to exclude files/folders

Found the solution: There is no need for these lines: files: [ {src: [‘.conf1’, ‘.conf2’, ‘./config.js’], dest: ‘output/toolkit/’, filter: ‘isFile’}, {src: [‘./css/**/*’, ‘./img/**/*’, ‘./js/**/*’, ‘./release/**/*’, ‘./lib/**/*’, ‘./locale/**/*’], dest: ‘output/toolkit/’}, {expand: true, cwd: ‘./’, src: [‘**’], dest: ‘output/’} ] because {expand: true, cwd: ‘./’, src: [‘**’], dest: ‘output/’} is a new copy step, copying all files … Read more

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

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”, “version”: “0.0.1”, “description”: “A basic test to see if we can ditch concat and use only uglify for JS files.”, “devDependencies”: { “grunt”: “^0.4.5”, “grunt-contrib-concat”: “^0.5.0”, “grunt-contrib-uglify”: “^0.6.0”, “load-grunt-tasks”: “^1.0.0”, … Read more

Integrating Protractor with Yeoman via Grunt

Install protractor and grunt-protractor-runner from npm: npm install protractor grunt-protractor-runner –save-dev Create a config file for protractor (protractor.conf.js), change specs and baseUrl to your test files and test server: exports.config = { seleniumAddress: ‘http://localhost:4444/wd/hub’, specs: [‘test/e2e/*_test.js’], baseUrl: ‘http://localhost:9001’ //default test port with Yeoman } Update your Gruntfile.js, add the following after the karma task: protractor: … Read more

Is it possible to compile grunt project from maven?

Yes, using the frontend-maven-plugin, you can compile Grunt projects via Maven (found via the NodeJS mailing list). As the documentation points out, the plugin has the following features: Let you keep your frontend and backend builds as separate as possible, by reducing the amount of interaction between them to the bare minimum; using only 1 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)