Skip to content

Commit

Permalink
Merge pull request TalAter#87 from PavelVanecek/feature-grunt-dev
Browse files Browse the repository at this point in the history
New grunt task added by @PavelVanecek for easier development
  • Loading branch information
TalAter committed Aug 21, 2014
2 parents 314c987 + 312a8be commit 5b2e738
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
15 changes: 15 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ module.exports = function(grunt) {
'demo/css/main.min.css': ['demo/css/main.css', 'demo/vendor/css/default.css', 'demo/vendor/css/github.css']
}
}
},
connect: {
server: {
options: {
protocol: 'https',
port: 8443,
hostname: '*',
base: '.'
}
}
}
});

Expand All @@ -91,7 +101,12 @@ module.exports = function(grunt) {
// Load the plugin that provides the "imagemin" task.
grunt.loadNpmTasks('grunt-contrib-imagemin');

// Load the plugin that provides the "connect" task.
grunt.loadNpmTasks('grunt-contrib-connect');

// Default task(s).
grunt.registerTask('default', ['jshint', 'uglify', 'cssmin']);

grunt.registerTask('dev', ['default', 'connect', 'watch']);

};
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ Author
------
Tal Ater: [@TalAter](https://twitter.com/TalAter)

Developing
-------

Prerequisities: node.js

First, install dependencies:

cd <project_folder>
npm install -g grunt-cli
npm install

Then run:

grunt dev

Point your browser to `https://localhost:8443/demo/` to see the demo page. Since it's using self-signed certificate, you might need to *"Proceed Anyway"*.

License
-------
Licensed under [MIT](https://github.com/TalAter/annyang/blob/master/LICENSE).
10 changes: 9 additions & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
<meta property="og:url" content="https://www.talater.com/annyang/"/>
<meta property="og:site_name" content="annyang"/>
<meta property="fb:admins" content="568390229" />
<script src="//cdnjs.cloudflare.com/ajax/libs/annyang/1.1.0/annyang.min.js"></script>
<script>
var annyangScript = document.createElement('script');
if (/localhost/.exec(window.location)) {
annyangScript.src = "//localhost:8443/annyang.js"
} else {
annyangScript.src = "//cdnjs.cloudflare.com/ajax/libs/annyang/1.1.0/annyang.min.js"
}
document.write(annyangScript.outerHTML)
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
"use strict";
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-cssmin": "~0.6.2",
"grunt-contrib-imagemin": "~0.3.0"
"grunt-contrib-imagemin": "~0.3.0",
"grunt-contrib-connect": "^0.8.0"
}
}

0 comments on commit 5b2e738

Please sign in to comment.