Skip to content

Commit

Permalink
Remove the global param '__project_theme__'.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed May 13, 2018
1 parent 5e21cf1 commit afc7c77
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/conf/path.js
Expand Up @@ -35,9 +35,9 @@ function getCinfigFilePath(fileName, type) {
const _path = PATH.resolve(appDirectory, 'theme', conf[type]);
const _NodeModulesPath = PATH.resolve(appDirectory, 'node_modules', conf[type]);
if (FS.existsSync(_path)) {
return _path;
return FS.realpathSync(_path);
} else if (FS.existsSync(_NodeModulesPath)) {
return _NodeModulesPath;
return FS.realpathSync(_NodeModulesPath);
}
return false;
}
Expand Down
6 changes: 5 additions & 1 deletion src/conf/webpack.config.dev.js
Expand Up @@ -16,6 +16,11 @@ module.exports = function (cmd) {
paths.appIndexJs,
];
config.mode = 'development';
config.resolve = {
alias: {
'rdoc-theme': UPATH.normalizeSafe(paths.appThemePath),
},
};
config.module.rules = config.module.rules.map((item) => {
if (item.oneOf) {
const loaders = [];
Expand All @@ -29,7 +34,6 @@ module.exports = function (cmd) {
options: {
multiple: [
{ search: '__project_root__', replace: UPATH.normalizeSafe(paths.projectPath) },
{ search: '__project_theme__', replace: UPATH.normalizeSafe(paths.appThemePath) },
],
},
},
Expand Down
6 changes: 5 additions & 1 deletion src/conf/webpack.config.prod.js
Expand Up @@ -17,6 +17,11 @@ module.exports = function (cmd) {
paths.appIndexJs,
];
config.mode = 'production';
config.resolve = {
alias: {
'rdoc-theme': UPATH.normalizeSafe(paths.appThemePath),
},
};
config.module.rules = config.module.rules.map((item) => {
if (item.oneOf) {
const loaders = [];
Expand All @@ -30,7 +35,6 @@ module.exports = function (cmd) {
options: {
multiple: [
{ search: '__project_root__', replace: UPATH.normalizeSafe(paths.projectPath) },
{ search: '__project_theme__', replace: UPATH.normalizeSafe(paths.appThemePath) },
],
},
},
Expand Down
2 changes: 1 addition & 1 deletion src/web/Router.js
@@ -1,7 +1,7 @@
import React from 'react';
import { HashRouter, withRouter, Route, Switch } from 'react-router-dom';
import lazyload from 'react-dynamic-loadable';
import theme from '__project_theme__';
import theme from 'rdoc-theme';
import menuSource from './rdoc.tree.data.json';

// 判断目录下是否存在 README.md
Expand Down
12 changes: 6 additions & 6 deletions templates/default/faq/README.md
Expand Up @@ -7,15 +7,15 @@ sort: 2

1. 是否支持 Markdown 中写代码?

> 支持在 Markdown 中写HTML、CSS。
> 支持在 Markdown 中写HTML、CSS。
2. 文档是否支持目录层级?

> 支持菜单无线层级,在文件夹中建立文件夹,相对应建立 `README.md`
> 支持菜单无线层级,在文件夹中建立文件夹,相对应建立 `README.md`
3. 新增文件不能热加载,监听文件变化?

> 新增一个 `Markdown` 文件是支持热加载的,需要如下步骤:
> - 添加完成之后必须 `Markdown` 文件不能为空。
> - 如果只是添加注释配置或者空格,一样视为空。
> - 在其它已加载的 `Markdown` 文件中保存一下。
> 新增一个 `Markdown` 文件是支持热加载的,需要如下步骤:
> - 添加完成之后必须 `Markdown` 文件不能为空。
> - 如果只是添加注释配置或者空格,一样视为空。
> - 在其它已加载的 `Markdown` 文件中保存一下。

0 comments on commit afc7c77

Please sign in to comment.