ant-design/nico.js

51 lines
1.3 KiB
JavaScript
Raw Normal View History

2015-05-09 17:36:15 +08:00
var path = require('path');
2015-06-04 14:42:24 +08:00
var package = require('./package');
var webpack = require('webpack');
var webpackMiddleware = require('webpack-dev-middleware');
var webpackConfig = require('./webpack.config');
var webpackCompiler = webpack(webpackConfig);
var handler;
2015-05-09 17:36:15 +08:00
// {{ settings for nico
2015-05-12 17:50:03 +08:00
exports.site = {
2015-06-04 14:42:24 +08:00
name: package.title,
2015-06-05 15:02:39 +08:00
description: package.description,
repo: package.repository.url,
issues: package.bugs.url
2015-05-12 17:50:03 +08:00
};
2015-06-09 15:50:36 +08:00
exports.theme = 'site';
2015-05-09 17:36:15 +08:00
exports.source = process.cwd();
exports.output = path.join(process.cwd(), '_site');
exports.permalink = '{{directory}}/{{filename}}';
exports.ignorefilter = function(filepath, subdir) {
var extname = path.extname(filepath);
if (extname === '.tmp' || extname === '.bak') {
return false;
}
if (/\.DS_Store/.test(filepath)) {
return false;
}
if (/^(_site|_theme|node_modules|\.idea)/.test(subdir)) {
return false;
}
return true;
};
exports.middlewares = [{
name: 'webpackDevMiddleware',
2015-06-16 20:10:30 +08:00
filter: /antd\.(js|css)(\.map)?$/,
handle: function(req, res, next) {
handler = handler || webpackMiddleware(webpackCompiler, {
publicPath: '/dist/',
lazy: false,
watchDelay: 200
});
return handler(req, res, next);
}
}];
2015-05-09 17:36:15 +08:00
exports.writers = [
2015-05-18 18:13:16 +08:00
'nico-jsx.PageWriter',
'nico-jsx.StaticWriter',
'nico-jsx.FileWriter'
2015-05-09 17:36:15 +08:00
];
// end settings }}