This commit is contained in:
cookfront
2017-04-10 10:46:50 +08:00
parent 481f46e41f
commit eccbd2269c
48 changed files with 77 additions and 58 deletions
+3 -3
View File
@@ -5,7 +5,7 @@ var path = require('path');
var cheerio = require('cheerio');
var chalk = require('chalk');
var striptags = require('./strip-tags');
var navs = require('../docs/nav.config.json');
var navs = require('../docs/src/nav.config.js');
navs = navs['zh-CN'];
var parser = markdownIt('default', {
@@ -31,9 +31,9 @@ var renderVueTemplate = function (html, componentName) {
var script = '';
if (output.script) {
script = output.script.replace('<script>', '<script>\nimport Vue from "vue";import ExampleBlock from "../components/example-block";Vue.component("example-block", ExampleBlock);');
script = output.script.replace('<script>', '<script>\nimport Vue from "vue";import ExampleBlock from "components/example-block";Vue.component("example-block", ExampleBlock);');
} else {
script = '<script>\nimport Vue from "vue";import ExampleBlock from "../components/example-block";Vue.component("example-block", ExampleBlock);</script>';
script = '<script>\nimport Vue from "vue";import ExampleBlock from "components/example-block";Vue.component("example-block", ExampleBlock);</script>';
}
result = `<template><section class="demo-${componentName}"><h1 class="demo-title">${componentName}</h1>` + output['example-block'] + '</section></template>\n' +
+5 -5
View File
@@ -35,8 +35,8 @@ function wrap(render) {
module.exports = {
entry: {
'vendor': ['vue', 'vue-router'],
'zan-docs': './docs/index.js',
'zan-examples': './docs/examples.js'
'zan-docs': './docs/src/index.js',
'zan-examples': './docs/src/examples.js'
},
output: {
path: path.join(__dirname, '../docs/dist'),
@@ -55,7 +55,7 @@ module.exports = {
'src': path.join(__dirname, '../src'),
'packages': path.join(__dirname, '../packages'),
'lib': path.join(__dirname, '../lib'),
'components': path.join(__dirname, '../docs/components')
'components': path.join(__dirname, '../docs/src/components')
}
},
module: {
@@ -150,13 +150,13 @@ module.exports = {
}),
new HtmlWebpackPlugin({
chunks: ['vendor', 'zan-docs'],
template: 'docs/index.tpl',
template: 'docs/src/index.tpl',
filename: 'index.html',
inject: true
}),
new HtmlWebpackPlugin({
chunks: ['vendor', 'zan-examples'],
template: 'docs/index.tpl',
template: 'docs/src/index.tpl',
filename: 'examples.html',
inject: true
}),