Skip to content

Commit

Permalink
update frontplate-cli v0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sable-virt committed Oct 8, 2016
1 parent 708af33 commit f08f586
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 3,4 @@
.DS_Store
node_modules
public
guide
8 changes: 5 additions & 3 deletions config/copy.config.js
Original file line number Diff line number Diff line change
@@ -1,4 1,6 @@
'use strict';
const core = require('./core.config');
module.exports = {
// "path/from": "/path/to"
"src/lib/**/*": "public/assets/lib"
};
// 'path/from': '/path/to'
'src/lib/**/*': core.basePath '/assets/lib'
};
3 changes: 3 additions & 0 deletions config/core.config.js
Original file line number Diff line number Diff line change
@@ -0,0 1,3 @@
module.exports = {
basePath: 'public'
};
16 changes: 14 additions & 2 deletions config/html.config.js
Original file line number Diff line number Diff line change
@@ -1,9 1,21 @@
'use strict';
const core = require('./core.config');
module.exports = {
src: 'src/view/**/*.ejs', // 読み込むビューファイル
dest: 'public', // 出力先
dest: core.basePath, // 出力先
params: { // ビューで使うグローバル変数
title: 'title'
},
// 1つのテンプレートで複数作成するときに使用する
pages: [
// {
// name: 'filename', // 出力するファイル名
// src: 'src/view/tmpl/_template.ejs', // テンプレート
// params: { // ページに渡す変数
// title: 'page title'
// }
// }
],
// htmlhintルール(https://github.com/yaniswang/HTMLHint/wiki/Rules)
rules: {
"tagname-lowercase": true,
Expand All @@ -27,4 39,4 @@ module.exports = {
"href-abs-or-rel": false,
"attr-unsafe-chars": true
}
};
};
6 changes: 4 additions & 2 deletions config/image.config.js
Original file line number Diff line number Diff line change
@@ -1,4 1,6 @@
'use strict';
const core = require('./core.config');
module.exports = {
src: 'src/images/*.{gif,jpg,png}', // 読み込むイメージ
dest: 'public/assets/images' // 出力先
};
dest: core.basePath '/assets/images' // 出力先
};
10 changes: 5 additions & 5 deletions config/server.config.js
Original file line number Diff line number Diff line change
@@ -1,9 1,9 @@
'use strict';
const core = require('./core.config');
module.exports = {
"server": 'public', // ドキュメントルート
"port": 3000, // ポート
"middleware": [
],
"server": core.basePath, // ドキュメントルート
"port": 3000, // ポート
"middleware": [],
"ghostMode": {
"clicks": true,
"scroll": true,
Expand All @@ -13,4 13,4 @@ module.exports = {
"toggles": true
}
}
};
};
15 changes: 12 additions & 3 deletions config/style.config.js
Original file line number Diff line number Diff line change
@@ -1,15 1,24 @@
'use strict';
const core = require('./core.config');
const SUPPORT_BROWSERS = [
'last 3 version',
'ie >= 9',
'Android >= 4.0'
];
module.exports = {
src: 'src/sass/**/*.scss', // 読み込むscss
dest: 'public/assets/css', // 出力先
dest: core.basePath '/assets/css', // 出力先
plugins: [ // postcssプラグイン
require('autoprefixer')({ // autoprefixer(https://github.com/postcss/autoprefixer)
browsers: SUPPORT_BROWSERS
})
]
};
],
styleguide: {
title: 'StyleGuide',
verbose: false,
clean: true,
params: {},
css: '../public/assets/css/style.css',
// script: '../public/assets/js/app.js',
}
};
5 changes: 3 additions & 2 deletions config/webpack.core.js
Original file line number Diff line number Diff line change
@@ -1,4 1,5 @@
'use strict';
const core = require('./core.config');
const webpack = require("webpack");
/**
* webpack config
Expand All @@ -9,7 10,7 @@ const webpackConfig = {
app: './src/js/app.js'
},
output: {
path: 'public/assets/js',
path: core.basePath '/assets/js',
publicPath: '/assets',
filename: "[name].js",
sourceMapFilename: 'maps/[name].map',
Expand All @@ -35,4 36,4 @@ const webpackConfig = {
})
]
};
module.exports = webpackConfig;
module.exports = webpackConfig;
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 3,12 @@
"version": "3.0.1",
"description": "フロントエンド開発の効率をあげるフルスタックテンプレート",
"dependencies": {},
"devDependencies": {
"frontplate-cli": "^0.2.3"
},
"devDependencies": {},
"scripts": {
"start": "frp build && frp serve -t",
"test": "frp build",
"build": "frp build",
"serve": "frp serve -t",
"serve": "frp serve",
"production": "frp build -p",
"changelog": "conventional-changelog -p eslint -i CHANGELOG.md -w -s -r 0"
},
Expand Down
3 changes: 3 additions & 0 deletions src/view/parts/_page.ejs
Original file line number Diff line number Diff line change
@@ -0,0 1,3 @@
<div>
<%= title%>
</div>

0 comments on commit f08f586

Please sign in to comment.