-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support html5mode(true) #90
base: master
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,19 @@ module.exports = function (grunt) { | |
connect: { | ||
main: { | ||
options: { | ||
port: 9001 | ||
port: 9001, | ||
middleware: function (connect) { | ||
var modRewrite = require('connect-modrewrite'); | ||
return [ | ||
modRewrite(['^[^\\.]*$ /index.html [L]']), | ||
connect.static('.tmp'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whats this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My bad, I copied and pasted the function from a modified project of mine. This isn't needed in the default setup you provide. Will update the PR. |
||
connect().use( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as comment above with the exception of the last connect.static('.'). That is required so the rewrite will know where the base is. |
||
'/bower_components', | ||
connect.static('./bower_components') | ||
), | ||
connect.static('.') | ||
]; | ||
} | ||
} | ||
} | ||
}, | ||
|
@@ -164,7 +176,7 @@ module.exports = function (grunt) { | |
} | ||
} | ||
}, | ||
//Imagemin has issues on Windows. | ||
//Imagemin has issues on Windows. | ||
//To enable imagemin: | ||
// - "npm install grunt-contrib-imagemin" | ||
// - Comment in this section | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not following the regex at the beginning here. Whats the intention?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it grabs the url segment and passes it to index.html. The regexp basically says give me anything that's not a "" or a "."