Skip to main content

Setting up a web project using Grunt, Bower and Yeoman



Grunt: task runner for minification, compilation, unit testing, linting, etc

Bower: Bower is a package manager for the front-end. It offers a generic, unopinionated solution to the problem of front-end package management. It installs the requested package with all dependencies.

Yeoman: is web project scafolding tool. we need to install its genarators for different projects. For example: angular-genarator, or melonjs-generator

brew install npm
npm install -g bower
bower install melonJS
npm install -g yeoman
npm install -g grunt
npm install -g grunt-cli
npm install -g generator-melonjs

mkdir project-folder
cd path/to/project-folder
yo melonjs

Answer to the questions then edit package.json add the followings to dependencies

"grunt-contrib-less": "latest",
"grunt-contrib-watch": "latest"
Run the following command:
npm install

Edit Gruntfile.js as the following
 grunt.loadNpmTasks('grunt-contrib-less');
 grunt.loadNpmTasks('grunt-contrib-watch');

--and edit the paths:
less: {
      style: {
        files: {
          "public/css/style.css": "less/style.less"
        }
      }
    },
    watch: {
      js: {
        files: ['javascript/*.js'],
        tasks: ['concat:js', 'uglify:js'],
        options: {
          livereload: true,
        }
      },
      css: {
        files: ['less/*.less'],
        tasks: ['less:style'],
        options: {
          livereload: true,
        }
      }
    }
Now run grunt watch 

Comments

Popular posts from this blog

Installing Django on IIS 7 Using PyISAPIe

PyISAPIe is an ISAPI extension which can be downlod from here . Download the latest extension according to installed python version. Just make sure that ISAPI and ISAPI filters has been installed on IIS (During IIS installation these two component should have checked). Copy PyISAPIe.dll file and Http folder into your Django website project.Example: Suppose your website folder path is: "C:\Python25\Lib\site-packages\MySite" "C:\Python25\Lib\site-packages\MySite\PyISAPIe.dll" and "C:\Python25\Lib\site-packages\MySite\Http" will be the result. Copy and replace the isap.py from "PyISAPIe\Examples\Django" folder to "C:\Python25\Lib\site-packages\MySite\Http" IIS need to have access to your project folder and also django folder. so you need to give access "Network Service" to these folder. Right click on site folder "C:\Python25\Lib\site-packages\MySite"  click on properties. On properties window choose the sec...

Installing MS SQL Server driver on Ubuntu Linux

Although making a connection to SQL Server can be done using unixODBC and FreeTDS, it does not work with some collations on SQL Server 2008. Recently, Microsoft released an ODBC driver for Linux that works on 64-bit systems only. Installing the driver is tricky. I begin by installing the build-essential, which is required for compiling from source. Checkinstall can be installed if you want to add the following application to the package manager. $ sudo apt-get install build-essential  Download unixODBC-2.3.0  and Microsoft ODBC dirver  and extract. $ sudo wget ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.0.tar.gz $ tar xvf unixODBC-2.3.0.tar.gz $ wget http://download.microsoft.com/download/6/A/B/6AB27E13-46AE-4CE9-AFFD-406367CADC1D/Linux6/sqlncli-11.0.1790.0.tar.gz $ tar xvf sqlncli-11.0.1790.0.tar.gz  Install the unixodbc using the following commands: $ ./configure --disable-gui --disable-drivers --enable-iconv --with-iconv-char-enc=UTF8 --with-ico...

Teaching an AI What WYSIWYG Actually Means

I wanted to integrate a WYSIWYG Markdown editor into my ReactJS application. I carefully explained what I was trying to achieve—but notably did not specify which library I wanted to use. This was intentional. I was curious to see how the agent would choose a library on its own, and whether it could reliably search for and identify a good tool for the job. I was using Opus with Cursor. After executing my request, I opened the page and immediately noticed something peculiar: although I could “edit” the content, the editing experience was limited to raw Markdown. The nicely formatted text—the whole point of WYSIWYG—was available only in preview mode. Naturally, I asked the agent to modify the application so users could edit the formatted text directly, like civilized people. The agent began to think. And think. I’m confident these were deep thoughts, because the pause was longer than usual. After a few seconds of coding, it triumphantly declared, “There you go—sorry, I didn’t understand...