Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
21 changes: 20 additions & 1 deletion meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = {
return templateVersion
},
},

prompts: {
name: {
type: 'string',
Expand Down Expand Up @@ -61,6 +60,26 @@ module.exports = {
type: 'confirm',
message: 'Install vue-router?',
},
deploy: {
type: 'confirm',
message: 'Setup a deploy command for GitHub pages?',
},
deployBuild: {
when: 'deploy',
type: 'confirm',
message: 'Build project when deploying?',
},
branch: {
when: 'deploy',
default: 'gh-pages',
type: 'string',
message: 'What branch should the built site be deployed to?',
},
baseUrl: {
when: 'deploy',
type: 'string',
message: 'What is the GitHub project? (Leave blank for User & Organization pages)',
},
lint: {
type: 'confirm',
message: 'Use ESLint to lint your code?',
Expand Down
5 changes: 4 additions & 1 deletion template/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ module.exports = {
// Paths
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
{{#deploy}}
assetsPublicPath: '/{{ baseUrl }}/',
{{else}}
assetsPublicPath: '/',

{{/deploy}}
/**
* Source Maps
*/
Expand Down
6 changes: 6 additions & 0 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
{{#lint}}
"lint": "eslint --ext .js,.vue src{{#unit}} test/unit/specs{{/unit}}{{#e2e}} test/e2e/specs{{/e2e}}",
{{/lint}}
{{#deploy}}
"deploy": "{{#deployBuild}}npm run build;{{/deployBuild}}push-dir --dir=dist --branch={{ branch }} --cleanup",
{{/deploy}}
"build": "node build/build.js"
},
"dependencies": {
Expand Down Expand Up @@ -103,6 +106,9 @@
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
{{#deploy}}
"push-dir": "^0.4.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

There's a package that makes this even easier imho: gh-pages

Have you considered it?

Copy link
Author

Choose a reason for hiding this comment

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

I did consider the gh-pages package, but when checking out both of the packages documentation, gh-pages just seems to make it more complicated than it should be.

With the push-dir package, any flags can simply be added to the package.json file, such as --allow-unclean and --force, if required by the end-user.

{{/deploy}}
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"optimize-css-assets-webpack-plugin": "^3.2.0",
Expand Down