Giter Site home page Giter Site logo

bisheng's Introduction

Bi Sheng

Build status npm package NPM downloads Dependency Status

Bi Sheng was the Chinese inventor of the first known movable type technology.

bisheng is designed to transform Markdown(and other static files with transformers) into static websites and blogs using React.

Sites built with BiSheng

You can create a PR to extend this list with your amazing website which is built with BiSheng.

Features

bisheng is based on dora & webpack & React & react-router, and it has the following features:

Big picture

Big picture of BiSheng

Articles

Usage

Installation:

npm install --save-dev bisheng

Then, add start to npm scripts:

{
  "scripts": {
    "start": "bisheng start"
  }
}

Create bisheng.config.js, otherwise bisheng will use the default config:

module.exports = {
  source: './posts',
  output: './_site',
  theme: './_theme',
  port: 8000,
};

Note: please make sure that source and theme exists, and theme should not be an empty directory. Just use bisheng-theme-one, if you don't know how to develop a theme. See a simple demo here.

Now, just run npm start.

Documentation

CLI

We can install bisheng as a cli command and explore what it can do by bisheng -h. However, the recommended way to use bisheng is to install it as devDependencies.

$ npm install -g bisheng
$ bisheng -h
  Usage: bisheng [command] [options]

  Commands:

    start [options]     to start a server
    build [options]     to build and write static files to `config.output`
    gh-pages [options]  to deploy website to gh-pages
    help [cmd]          display help for [cmd]

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

Configuration

bisheng will read bisheng.config.js as its config file, but we can set the config file name by --config, something like this bisheng --config another.config.js.

The content of bisheng.config.js looks like this:

module.exports = {
  port: 8000,
  source: './posts',
  output: './_site',
  theme: './_theme',
  htmlTemplate: path.join(__dirname, '../template.html'),
  devServerConfig: {},
  webpackConfig(config) {
    return config;
  },
  hash: false,

  entryName: 'index',
  root: '/',
};

port: Number

default: 8000

To set the port which will be listened when we start a local server.

source: String | Array[String] | Object{ [category]: String | Array[String]}

default: './posts'

To set directory/directories where we place Markdown files.

And all the Markdown files in source will be parsed and then structured as a tree data, for example:

posts
└── dir1
  ├── a.md
  └── b.md

Will output a Markdown data tree:

{
  dir1: {
    a: {...},
    b: {...},
  },
}

And each Markdown file will be parsed as a Markdown data. Actually, a Markdown data is the returned value of mark-twain, and it could be preprocessed by plugins.

exclude: RegExp

default: null

If you want to exclude some files in your source, just use exclude. Then bisheng will not parse files which match exclude.

output: String

default: './_site'

To set directory where bisheng will generate (HTML & CSS & JavaScript) files to.

theme: String

default: './_theme'

To set directory where we put the theme of website, and it also can be a npm package name.

More about theme.

themeConfig: any

undefined

A set of configuration that your theme provides, and then your theme can read it from props.themeConfig.

Note: themeConfig will be JSON.stringify before it's passed to props, so you cannot pass function/RegExp through themeConfig.

htmlTemplate: String

default: bisheng/lib/template.html

The HTML template which will be use to generate HTML files which will be sent to users.

Note: template will be parsed by nunjucks, and you can use the following variables in this template:

htmlTemplateExtraData: Object

default: {}

The Extra Data which will be used to render htmlTemplate.

devServerConfig: Object

default: {}

You can consult webpack-dev-server's documentation.

postcssConfig: Object

default: {
    plugins: [
      rucksack(),
      autoprefixer({
        browsers: ['last 2 versions', 'Firefox ESR', '> 1%', 'ie >= 8', 'iOS >= 8', 'Android >= 4'],
      }),
    ],
  }

You can consult webpack postcss-loader's documentation.

webpackConfig: (config) => config

default: (config) => config

To modify the webpack config, you can extend the config like this.

transformers: Object[]

[{ test: /.md$/, use: MarkdownTransformer }]

A list of transformers that will be used to transform static files.

entryName: String

default: 'index'

The name of files which will be generated by webpack, such as [entryName].js & [entryName].css.

root: String

default: '/'

If the website will be deployed under a sub-directory of a domain (something like http://benjycui.github.io/bisheng-theme-one/), we must set it (such as /bisheng-theme-one/).

License

MIT

bisheng's People

Contributors

afc163 avatar amour1688 avatar annatarhe avatar bang88 avatar bchensyd avatar benjycui avatar bh-m87 avatar ehmicky avatar eternalsky avatar ioslh avatar jimt avatar jinyang1994 avatar jljsj33 avatar l-7-l avatar leuisken avatar luin-li avatar madccc avatar noyobo avatar paranoidjk avatar sirzxj avatar snadn avatar sskyy avatar suixinlei avatar vagusx avatar vision-ken avatar ycjcl868 avatar yesmeck avatar zombiej avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bisheng's Issues

bisheng build详细咨询

我的项目用bisheng构建,bisheng start本地起服务已经没问题了,现在想打包到本地,
然后bisheng build,输出一个site文件夹。 然后本地打开index.html页面只是出来一个404。其他正常的页面都出不来。 应该怎么解决。

或者拿你的例子bisheng-theme-demo举例子。 bisheng build完了后,打开site/index.html后出来404的页面,其他的页面不知道怎么打开。

看到回复下。项目急。 感激不尽

An error occur while loading empty file ‘bisheng/lib/utils/data.js’ in file 'template-wrapper.nunjucks.js'

I am translating antd Chinese Document to English version. But i encounter some problem while running the program.

environment

name version
platform windows
bisheng 0.9.6
bisheng-plugin-antd 0.2.2

An error occur while loading empty file ‘bisheng/lib/utils/data.js’ in file 'template-wrapper.nunjucks.js'

image

image

cannot solve path properly on windows platform

something like this:
const NotFound = require('d:\openSoursePro\ant-design\site\theme/template/NotFound');

update documentation

  1. add missing documentation for APIs
  • lazyLoad
  • pick
  1. add a picture for data flow.

BiSheng 一期系分

BiSheng 是一个基于 dora webpack react 实现并支持插件扩展的建站工具。

Config

运行 bisheng start 后,会读取当前目录下的 bisheng.config.js

// ./bisheng.config.js
export default {
  // 使用 [mark-twain](https://github.com/benjycui/mark-twain) 分析 `source` 指定目录下面的 Markdown
  // 并按照目录结构把处理后的数据,集成到一个对象上
  // {
  //    posts: {
  //      'hello-world.md': require('./posts/hello-world.md')
  //    }
  // }
  source: './posts', // or ['components', 'docs']

  // 用户可以根据自己的习惯配置 Markdown 的后缀
  extension: '.md', // or ['.markdown', '.md']

  // 用于存放最后构建出来的 `index.html` `index.js` `index.css` ...
  output: './_site',

  // `theme` 目录的结构见下文
  theme: './_theme',

  // 插件从左到右依次加载,具体插件机制见下文
  plugins: [ 'bisheng-plugin-antd?query' ],

  // 本地启动时使用的端口号
  port: 8000,

  // 修改默认的 webpack 配置,不设置该字段则使用默认配置
  webpackConfig(config, webpack) {
    // modify config
    return config;
  },
};

Theme

theme 的目录结构如下:

./_theme/
  template/  # *.jsx
  static/  # *.css *.less ...
  index.js

theme/index.js

可选,包含路由以及将来可能的扩展。

// ./_theme/index.js
export default {
  // 当访客访问某个路由时,使用对应的 React.Component 进行渲染
  // 访问不存在的路由时,使用 `./template/NotFound`
  // 当不提供 `routes` 时,使用默认路由
  // {
  //    '/': require('./template/Home'),
  //    '/archive': require('./template/Archive'),
  //    '/posts/:post': require('./template/Article'),
  //    ...
  // }
  routes: {
    '/': require('./template/Home'),
    '/changelog': require('./template/Article'),
    '/docs/react/:doc': require('./template/Article'),
    '/components/:component': require('./template/ComponentDoc'),
  },
};

模板

./_theme/template/*.jsx 为一个 React.Component:

import React from 'react';

// `props` 包含以下属性:
//   `data`,根据 `bisheng.config.js` 中的 `source` 生成的数据对象
//   `utils`,bisheng 或者插件提供的包括 `get` `toReactComponent` 在内的一些工具方法
//   `localtion` 等 react-router 传进来的属性
export default ({ data, utils, location ... }) => {
  const nestedProps = location.pathname.replace(/^\//, '').split('/');
  // utils.get 即是 [exist.get](https://github.com/benjycui/exist.js#existgetobj-nestedprop-defaultvalue)
  const pageData = utils.get(data, nestedProps);
  return (
    <section className="markdown">
      // utils.toReactComponent 在 [jsonml-to-react-component](https://github.com/benjycui/jsonml-to-react-component)
      //  上面包装而来
      { utils.toReactComponent(pageData.content) }
    </section>
  );
};

Plugins

Ant Design 等的官网可以通过插件扩展 bisheng 的方式来实现,一个插件包含两部分:

// plugin/lib/browser.js
export default (config) {
  return {
    // 插件提供的一些工具方法
    utils: { ... },

    // jsonml-to-react-component 中的 converters https://github.com/benjycui/jsonml-to-react-component#converters-arraypairfunction-function
    // 现在 Ant Design 官网使用这种方法为 `video` 添加播放按钮,为 `img` 添加预览功能。
    converters: [
      ...
    ]
  };
};
// plugin/lib/node.js

// pageData 为 mark-twain 返回的对象,中间可能经过其它插件加工过
// 现在 Ant Design 官网在这步对代码进行高亮,并增加国际化支持
export default (pageData, query) => {
  // modify pageData
  return pageData;
};

[HELP] bisheng 我要用 hashHistory!

router 我要用 hashHistory! 该怎么配置?


const router = React.createElement(ReactRouter.Router, {
  history: ReactRouter.useRouterHistory(history.createHistory)({
    basename: '/',
  }),
  routes: processedRoutes,
  createElement,
});

to


const router = React.createElement(ReactRouter.Router, {
  history: ReactRouter.hashHistory,
  routes: processedRoutes,
  createElement,
});

site的路由问题

你好,我想build后生成的site应该是一个静态站点,我打开跳404了,请问下是什么原因,应该如何使用

support omit ReactDOM.render

remove

ReactDOM.render(<ButtonExample />, mountNode);

from markdown

conventional class name: Component+FileName+Example

pick api 的问题

这是 ant-design 的 bisheng config

pick: {
    components(markdownData) {
      const filename = markdownData.meta.filename;
      if (!/^components/.test(filename) ||
          /\/demo$/.test(path.dirname(filename))) return;
      return {
        meta: markdownData.meta,
      };
    },
    changelog(markdownData) {
      if (/CHANGELOG/.test(markdownData.meta.filename)) {
        return {
          meta: markdownData.meta,
        };
      }
    },
    'docs/pattern': pickerGenerator('pattern'),
    'docs/practice': pickerGenerator('practice'),
    'docs/react': pickerGenerator('react'),
    'docs/resource': pickerGenerator('resource'),
    'docs/spec': pickerGenerator('spec'),
  }

上述 components 的部分,在antd 中会有 catagory: components 一类的字段,但是我配置成自己的目录,markdownData 的值就有差异了。不知道是什么原因造成的

bisheng-plugin-description

To support extended Markdown syntax:

---
// here is meta data which is written in YAML

---

// here is description

---

// main content

1.0

由于:

  • bisheng 的使用范围和功能都已经超出了最初的设计
  • 现在虽然已经 make it work,但还需要 make it better

1.0 会重新梳理已有的功能和设计,然后进行优化。


  • Improve syntax of collect function.
@collect(async (nextProps) => {
  ...
  return processedNextProp;
})
class Layout extends React.Component {
  ...
}
  • config.sourcerecommend absolute path
  • pageData 不存在不会导致 404
  • pass props to plugin/browser.js ref: ant-design/ant-design#4221
  • replace template.nunjucks with template.jsx???

bisheng 在window下themePath出错

ERROR in .//bisheng/lib/entry.nunjucks.js
Module not found: Error: Cannot resolve module 'D:ant-designsite heme' in D:\ant-design\node_modules\bisheng\lib
@ ./
/bisheng/lib/entry.nunjucks.js 14:12-47

ERROR in .//bisheng/lib/utils/template-wrapper.nunjucks.js
Module not found: Error: Cannot resolve module 'D:ant-designsite heme/template/NotFound' in D:\ant-design\node_modules\bisheng\lib\utils
@ ./
/bisheng/lib/utils/template-wrapper.nunjucks.js 7:15-68

ERROR in .//bisheng/lib/utils/template-wrapper.nunjucks.js
Module not found: Error: Cannot resolve module 'D:ant-designsite heme' in D:\ant-design\node_modules\bisheng\lib\utils
@ ./
/bisheng/lib/utils/template-wrapper.nunjucks.js 46:17-83

ERROR in .//bisheng/lib/utils/data.js
Module parse failed: D:\ant-design\node_modules\bisheng\lib\loaders\bisheng-data-loader.js?config=D:\ant-design\site\bisheng.config.js!D:\ant-design\node_modules\bisheng\lib\utils\data.js Line 18: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| 'components\back-top\demo\custom': require('D:\ant-design\components\back-top\demo\custom.md'),
| 'components\back-top\index': require('D:\ant-design\components\back-top\index.md'),
| 'components\badge\demo\99plus': require('D:\ant-design\components\badge\demo\99plus.md'),
| 'components\badge\demo\basic': require('D:\ant-design\components\badge\demo\basic.md'),
| 'components\badge\demo\change': require('D:\ant-design\components\badge\demo\change.md'),
@ ./
/bisheng/lib/utils/template-wrapper.nunjucks.js 8:11-31

routes配置带参数路由

routes: {
'/test': './template/Test/index',
'/test/: parameter': './template/Home/index'
},
如上,建议支持这种带参数的路由配置

start / build 占用内存超过默认上限

  2203/2206 build modules
<--- Last few GCs --->

  112843 ms: Scavenge 1300.3 (1423.8) -> 1300.3 (1424.8) MB, 15.3 / 0 ms (+ 9.1 ms in 236 steps since last GC) [allocation failure].
  112876 ms: Scavenge 1301.3 (1424.8) -> 1301.3 (1434.8) MB, 31.9 / 0 ms (+ 0.0 ms in 16 steps since last GC) [allocation failure].
  112957 ms: Scavenge 1311.8 (1434.8) -> 1311.8 (1434.8) MB, 19.9 / 0 ms (+ 53.0 ms in 167 steps since last GC) [allocation failure].
  112993 ms: Scavenge 1311.8 (1434.8) -> 1311.8 (1434.8) MB, 35.7 / 0 ms [allocation failure].


<--- JS stacktrace --->
Cannot get stack trace in GC.
FATAL ERROR: MarkCompactCollector: semi-space copy, fallback in old gen Allocation failed - JavaScript heap out of memory

两个react版本冲突怎么解决

bisheng的react的版本是15.4.1。 我的库的react的版本是14.8.2
然后引起以下问题(因为用了两个版本的react)

nhandled rejection Invariant Violation: addComponentAsRefTo(...): 
Only a ReactOwner can have refs.

本来我觉得bisheng.config.js中webpack设置下externals就可以了

    config.externals = {
       react: 'React',
       'react-dom': 'ReactDOM'
     };

结果报错 react is not defined

不知道怎么解决了

webpack config加入sass-loader后。

从命令行全局运行bisheng start -c 'xxx.config.js'没问题,但是用npm run script就报错。

ERROR in ./~/atool-build/~/css-loader?importLoaders=2&sourceMap!./~/atool-build/~/autoprefixer/lib/autoprefixer.js?browsers=last 2 version!./~/atool-build/~/sass-loader/lib/loader.js?outputStyle=expanded&sourceMap!./demoSite/src/static/index.scss
Module build failed: CssSyntaxError: /css-loader!/Users/royguo/Documents/www/componentSystem/node_modules/atool-build/node_modules/autoprefixer/lib/autoprefixer.js?browsers=last 2 version!/Users/royguo/Documents/www/componentSystem/node_modules/atool-build/node_modules/sass-loader/lib/loader.js?outputStyle=expanded&sourceMap!/Users/royguo/Documents/www/componentSystem/demoSite/src/static/index.scss:2:7: Unknown word

估计跟atool-build有关。这是啥情况恩。

主题制作, 如何添加 loader

bisheng.config.js

webpackConfig: function(config) {
    config.module.loaders.push({
      test: /\.scss$/,
      loader: ExtractTextPlugin.extract('css!sass')
    })
    return config;
  }

将无法正常构建.

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/fsevents.js
Critical dependencies:
11:13-71 the request of a dependency is an expression
 @ ./~/.npminstall/fsevents/1.0.12/fsevents/fsevents.js 11:13-71

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/pre-binding.js
Critical dependencies:
19:22-48 the request of a dependency is an expression
 @ ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/pre-binding.js 19:22-48

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/util/versioning.js
Critical dependencies:
15:20-67 the request of a dependency is an expression
 @ ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/util/versioning.js 15:20-67

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/util/compile.js
Module not found: Error: Cannot resolve module 'npm' in /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/node_modules/node-pre-gyp/lib/util
 @ ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/util/compile.js 39:27-49

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/LICENSE
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/LICENSE Line 1: Unexpected identifier
You may need an appropriate loader to handle this file type.
| MIT License
| -----------
|
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/Readme.md
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/Readme.md Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| # fsevents [![NPM](https://nodei.co/npm/fsevents.png)](https://nodei.co/npm/fsevents/)
|
| Native access to OS X FSEvents in [Node.js](http://nodejs.org/)
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/binding.gyp
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/binding.gyp Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "targets": [
|     { "target_name": "" }
|   ],
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/build/Makefile
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/build/Makefile Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| # We borrow heavily from the kernel build setup, though we are simpler since
| # we don't have Kconfig tweaking settings on us.
|
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/build/Release/fse.node
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/build/Release/fse.node Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/build/action_after_build.target.mk
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/build/action_after_build.target.mk Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| # This file is generated by gyp; do not edit.
|
| TOOLSET := target
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/build/binding.Makefile
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/build/binding.Makefile Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| # This file is generated by gyp; do not edit.
|
| export builddir_name ?= ./build/.
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/build/config.gypi
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/build/config.gypi Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| # Do not edit. File was generated by node-gyp's "configure" step
| {
|   "target_defaults": {
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/build/fse.target.mk
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/build/fse.target.mk Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| # This file is generated by gyp; do not edit.
|
| TOOLSET := target
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/build/Release/obj.target/fse/fsevents.o
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/build/Release/obj.target/fse/fsevents.o Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/fsevents.cc
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/fsevents.cc Line 6: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| */
|
| #include "nan.h"
| #include "uv.h"
| #include "v8.h"
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/build/gyp-mac-tool
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/build/gyp-mac-tool Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
| #!/usr/bin/env python
| # Generated by gyp. Do not edit.
| # Copyright (c) 2012 Google Inc. All rights reserved.
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/src/async.cc
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/src/async.cc Line 7: Unexpected token {
You may need an appropriate loader to handle this file type.
|
|
| void async_propagate(uv_async_t *async) {
|   if (!async->data) return;
|   FSEvents *fse = (FSEvents *)async->data;
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/src/constants.cc
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/src/constants.cc Line 7: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
|
| // constants from https://developer.apple.com/library/mac/documentation/Darwin/Reference/FSEvents_Ref/index.html#//apple_ref/doc/constant_group/FSEventStreamEventFlags
| #ifndef kFSEventStreamEventFlagNone
| #define kFSEventStreamEventFlagNone 0x00000000
| #endif
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/src/methods.cc
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/src/methods.cc Line 6: Unexpected token :
You may need an appropriate loader to handle this file type.
| */
|
| void FSEvents::emitEvent(const char *path, UInt32 flags, UInt64 id) {
|   if (!handler) return;
|   Nan::HandleScope handle_scope;
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/src/storage.cc
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/src/storage.cc Line 6: Unexpected identifier
You may need an appropriate loader to handle this file type.
|  */
|
| struct fse_event {
|   UInt64 id;
|   UInt32 flags;
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/src/thread.cc
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/src/thread.cc Line 7: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
|
| // constants from https://developer.apple.com/library/mac/documentation/Darwin/Reference/FSEvents_Ref/index.html#//apple_ref/doc/constant_group/FSEventStreamCreateFlags
| #ifndef kFSEventStreamCreateFlagNone
| #define kFSEventStreamCreateFlagNone 0x00000000
| #endif
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/src/locking.cc
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/src/locking.cc Line 6: Unexpected token :
You may need an appropriate loader to handle this file type.
| */
|
| void FSEvents::lockingStart() {
|   if (lockStarted) return;
|   lockStarted = true;
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/test/fsevents.js
Critical dependencies:
23:11-21 the request of a dependency is an expression
 @ ./~/.npminstall/fsevents/1.0.12/fsevents/test/fsevents.js 23:11-21

WARNING in ./~/.npminstall/fsevents/1.0.12/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node
Module parse failed: /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/lib/binding/Release/node-v48-darwin-x64/fse.node Line 1: Unexpected token ILLEGAL
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
 @ ./~/.npminstall/fsevents/1.0.12/fsevents ^\.\/.*$

ERROR in ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/node-pre-gyp.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../package in /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/node_modules/node-pre-gyp/lib
 @ ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/node-pre-gyp.js 60:16-37

ERROR in ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/info.js
Module not found: Error: Cannot resolve module 'aws-sdk' in /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/node_modules/node-pre-gyp/lib
 @ ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/info.js 14:14-32

ERROR in ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/publish.js
Module not found: Error: Cannot resolve module 'aws-sdk' in /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/node_modules/node-pre-gyp/lib
 @ ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/publish.js 17:14-32

ERROR in ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/unpublish.js
Module not found: Error: Cannot resolve module 'aws-sdk' in /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/node_modules/node-pre-gyp/lib
 @ ./~/.npminstall/fsevents/1.0.12/fsevents/~/node-pre-gyp/lib/unpublish.js 15:14-32

ERROR in ./~/.npminstall/node-gyp/3.4.0/node-gyp/lib/node-gyp.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../package in /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/node-gyp/3.4.0/node-gyp/lib
 @ ./~/.npminstall/node-gyp/3.4.0/node-gyp/lib/node-gyp.js 78:16-37

ERROR in ./~/.npminstall/fsevents/1.0.12/fsevents/test/fsevents.js
Module not found: Error: Cannot resolve module 'tap' in /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/test
 @ ./~/.npminstall/fsevents/1.0.12/fsevents/test/fsevents.js 9:11-25

ERROR in ./~/.npminstall/fsevents/1.0.12/fsevents/test/function.js
Module not found: Error: Cannot resolve module 'tap' in /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/fsevents/1.0.12/fsevents/test
 @ ./~/.npminstall/fsevents/1.0.12/fsevents/test/function.js 11:11-25

ERROR in ./~/.npminstall/node-gyp/3.4.0/node-gyp/lib/configure.js
Module not found: Error: Cannot resolve module 'path-array' in /Users/noyobo/home/gitlab/ice/docs/node_modules/.npminstall/node-gyp/3.4.0/node-gyp/lib
 @ ./~/.npminstall/node-gyp/3.4.0/node-gyp/lib/configure.js 17:16-37
Child extract-text-webpack-plugin:
    chunk    {0} extract-text-webpack-plugin-output-filename 5.66 kB [rendered]
        [0] ./~/.npminstall/css-loader/0.23.1/css-loader?sourceMap&-restructuring!./~/.npminstall/postcss-loader/0.8.2/postcss-loader!./~/.npminstall/nprogress/0.2.0/nprogress/nprogress.css 4.16 kB {0} [built]
        [1] ./~/.npminstall/css-loader/0.23.1/css-loader/lib/css-base.js 1.51 kB {0} [built]

页面通用元素不要时时刷新。。。

增加个顶级嵌套路由,把通用元素放在顶级 route 里。如把 header 与 footer 放在一级里。。

<Router history={hashHistory}>
  <Route component={Index} ignoreScrollBehavior>
    <Route path="/" component={Home}/>
    <Route path="/:pageName/" component={Page} />
    <Route path="/:pageName/:contentName" component={Page} />
  </Route>
</Router>

放在 Index 里,,在 Index 加上进出场动画。。。

我现在在 bisheng 里加个 parentRoute:

index.js:

parentRoute: {
    component: require('./template/Layout/index'),
    ignoreScrollBehavior: true,
  }

entry.numjucks.js:

const router = React.createElement(ReactRouter.Router, {
  history: ReactRouter.useRouterHistory(history.createHistory)({
    basename: '{{ root }}',
  }),
  children: theme.parentRoute ? React.createElement(Route, {
    ...theme.parentRoute,
    key: 'common-route',
    onEnter: () => NProgress.start(),
    children: redirects.concat(routes),
  }) : redirects.concat(routes),
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.