nico.js 1.3 KB
Newer Older
A
update  
afc163 已提交
1
var path = require('path');
A
afc163 已提交
2 3
var webpackMiddleware = require("webpack-dev-middleware");
var webpack = require('webpack');
A
update  
afc163 已提交
4 5

// {{ settings for nico
A
aside  
afc163 已提交
6 7 8
exports.site = {
  name: 'Ant Design'
};
A
update  
afc163 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
exports.theme = 'theme';
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.writers = [
A
afc163 已提交
27 28 29
  'nico-jsx.PageWriter',
  'nico-jsx.StaticWriter',
  'nico-jsx.FileWriter'
A
update  
afc163 已提交
30
];
A
afc163 已提交
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
exports.middlewares = [{
  name: 'webpack',
  filter: /index\.js/,
  handle: webpackMiddleware(webpack(require('./webpack.config')), {
    // all options optional

    noInfo: false,
    // display no info to console (only warnings and errors)

    watchDelay: 300,
    // delay after change (only lazy: false)

    publicPath: "/dist/",
    // public path to bind the middleware to
    // use the same as in webpack

    headers: { "X-Custom-Header": "yes" },
    // custom headers

    stats: {
      colors: true
    }
    // options for formating the statistics
  })
}];
A
update  
afc163 已提交
56
// end settings }}