Skip to content

Commit

Permalink
fix: write with winos
Browse files Browse the repository at this point in the history
  • Loading branch information
deot committed Jan 20, 2020
1 parent 9f0f6fa commit 6a1f8c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions node/helper/generate-routes.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const path = require('path');
const { normalize } = require('upath');
const { js: beautify } = require('js-beautify');

module.exports = ({ sourceDir, routes, locales }) => {
let langs = Object.keys(locales) || [''];
let content = '';

// TODO: 文件是否存在
const getPath = (mode, type, lang) => {
if (typeof type === 'string') {
return type === 'default'
? `require('${path.resolve(__dirname, `../../client/src/components/${mode}.vue`)}').default`
: `require('${path.resolve(sourceDir, `./${lang}`, type)}').default`;
? `require('${normalize(path.resolve(__dirname, `../../client/src/components/${mode}.vue`))}').default`
: `require('${normalize(path.resolve(sourceDir, `./${lang}`, type))}').default`;
} else if (typeof type === 'object' && type != null) {
return `require('${path.resolve(__dirname, `../../client/src/components/${mode}.vue`)}').default`;
return `require('${normalize(path.resolve(__dirname, `../../client/src/components/${mode}.vue`))}').default`;
}

return null;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wya/doc",
"version": "1.0.5",
"version": "1.0.6",
"description": "wya-doc for js",
"main": "index.js",
"files": [
Expand Down Expand Up @@ -74,6 +74,7 @@
"portfinder": "^1.0.25",
"sass-loader": "^8.0.0",
"sass-resources-loader": "^2.0.1",
"upath": "^1.2.0",
"url-loader": "^3.0.0",
"vue": "^2.6.10",
"vue-loader": "^15.7.2",
Expand Down

0 comments on commit 6a1f8c4

Please sign in to comment.