Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions app/templates/skeleton/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]']),
Copy link
Owner

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?

Copy link
Author

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 "."

connect.static('.tmp'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats this?

Copy link
Author

Choose a reason for hiding this comment

The 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(
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Author

Choose a reason for hiding this comment

The 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('.')
];
}
}
}
},
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion app/templates/skeleton/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"name": "<%= _.camelize(appname) %>",
"version": "0.0.0",
"devDependencies": {
"connect-modrewrite": "~0.7.9",
"grunt": "~0.4",
"grunt-angular-templates": "~0.5",
"grunt-browser-output": "0.1.0",
"grunt-contrib-clean": "~0.5",
"grunt-contrib-concat": "~0.3",
"grunt-contrib-connect": "~0.6",
"grunt-contrib-connect": "~0.8",
"grunt-contrib-copy": "~0.5",
"grunt-contrib-cssmin": "~0.7",
"grunt-contrib-htmlmin": "~0.1",
Expand Down