Skip to content

Instantly share code, notes, and snippets.

@atian25
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atian25/9047610 to your computer and use it in GitHub Desktop.
Save atian25/9047610 to your computer and use it in GitHub Desktop.
grunt-express issue
D:\Workspace\Code\test\test-grunt
λ grunt server
Running "express:server" (express) task
Running "parallel:express_server_server" (parallel) task
Running "express-watch-livereload:D:\Workspace\Code\test\test-grunt\src:server:35729" (express-watch-livereload
) task
Running "watch:express_\Workspace\Code\test\test-grunt\src_livereload" (watch) task
Waiting...Running "express-watch-server:server:C:\Users\TZ\AppData\Local\Temp\express114117-5204-9jy3hk\server.
server" (express-watch-server) task
Running "watch:express_server_server" (watch) task
Waiting...OK
Running "express-server:server:C" (express-server) task
Web server started on port:9000, no hostname specified [pid: 8176]
Running "express-keepalive" task
module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('grunt-express');
grunt.initConfig({
express: {
options: {
port: 9000,
hostname: '*'
},
server: {
livereload: true,
options: {
serverreload: true,
livereload: 35729,
bases: ['./src'],
//bases: ['src']
}
}
}
});
grunt.registerTask('server', ['express', 'express-keepalive']);
}
<html>
<head>
</head>
<body>
<!-- at src/index.html -->
testaaaaa!!!!
</body>
</html>
D:\Workspace\Code\test\test-grunt
λ npm list
test-grunt@ D:\Workspace\Code\test\test-grunt
├─┬ grunt@0.4.2
│ ├── async@0.1.22
│ ├── coffee-script@1.3.3
│ ├── colors@0.6.2
│ ├── dateformat@1.0.2-1.2.3
│ ├── eventemitter2@0.4.13
│ ├── exit@0.1.2
│ ├─┬ findup-sync@0.1.2
│ │ └── lodash@1.0.1
│ ├── getobject@0.1.0
│ ├─┬ glob@3.1.21
│ │ ├── graceful-fs@1.2.3
│ │ └── inherits@1.0.0
│ ├── hooker@0.2.3
│ ├── iconv-lite@0.2.11
│ ├─┬ js-yaml@2.0.5
│ │ ├─┬ argparse@0.1.15
│ │ │ ├── underscore@1.4.4
│ │ │ └── underscore.string@2.3.3
│ │ └── esprima@1.0.4
│ ├── lodash@0.9.2
│ ├─┬ minimatch@0.2.14
│ │ ├── lru-cache@2.5.0
│ │ └── sigmund@1.0.0
│ ├─┬ nopt@1.0.10
│ │ └── abbrev@1.0.4
│ ├─┬ rimraf@2.0.3
│ │ └── graceful-fs@1.1.14
│ ├── underscore.string@2.2.1
│ └── which@1.0.5
└─┬ grunt-express@1.2.1
├─┬ connect@2.7.11
│ ├── buffer-crc32@0.2.1
│ ├── bytes@0.2.0
│ ├── cookie@0.0.5
│ ├── cookie-signature@1.0.1
│ ├── debug@0.7.4
│ ├── formidable@1.0.14
│ ├── fresh@0.1.0
│ ├── pause@0.0.1
│ ├── qs@0.6.5
│ └─┬ send@0.1.1
│ ├── mime@1.2.11
│ └── range-parser@0.0.4
├── connect-livereload@0.2.0
├─┬ grunt-contrib-watch@0.5.3
│ ├─┬ gaze@0.4.3
│ │ └─┬ globule@0.1.0
│ │ ├─┬ glob@3.1.21
│ │ │ ├── graceful-fs@1.2.3
│ │ │ └── inherits@1.0.0
│ │ ├── lodash@1.0.1
│ │ └─┬ minimatch@0.2.14
│ │ ├── lru-cache@2.5.0
│ │ └── sigmund@1.0.0
│ └─┬ tiny-lr@0.0.4
│ ├── debug@0.7.4
│ ├── faye-websocket@0.4.4
│ ├─┬ noptify@0.0.3
│ │ └─┬ nopt@2.0.0
│ │ └── abbrev@1.0.4
│ └── qs@0.5.6
├─┬ grunt-parallel@0.3.1
│ ├── lpad@0.1.0
│ └── q@0.8.12
├── lodash@1.3.1
├── open@0.0.4
├─┬ temp@0.5.1
│ └─┬ rimraf@2.1.4
│ └── graceful-fs@1.2.3
└─┬ touch@0.0.3
└─┬ nopt@1.0.10
└── abbrev@1.0.4
{
"name": "test-grunt",
"description": "",
"main": "index.js",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-express": "~1.2.1"
}
}
D:\Workspace\Code\test\test-grunt
λ npm list
test-grunt@ D:\Workspace\Code\test\test-grunt
├─┬ test-grunt
│ ├─┬ src
│ │ └── index.html
│ ├── package.json
│ ├─┬ Gruntfile.js
<html>
<head>
</head>
<body>
<!-- at src/index.html -->
testaaaaa!!!!
<!-- livereload script -->
<script type="text/javascript">document.write('<script src="http://'
+ (location.host || 'localhost').split(':')[0]
+ ':35729/livereload.js?snipver=1" type="text/javascript"><\/script>')
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment