Doc: remove unused script in site

This commit is contained in:
陈嘉涵
2017-09-04 11:01:17 +08:00
parent 2b6db8dc14
commit 8a951895f8
28 changed files with 161 additions and 385 deletions

View File

@@ -101,30 +101,16 @@ module.exports = {
new webpack.LoaderOptionsPlugin({
minimize: true,
options: {
vue: {
autoprefixer: false
},
vueMarkdown: {
preventExtract: true,
use: [
[
require('markdown-it-container'),
'demo',
{
validate: function(params) {
return params.trim().match(/^demo\s*(.*)$/);
},
render: function(tokens, idx) {
return tokens[idx].nesting === 1
? `<demo-block class="demo-box"><div class="highlight" slot="highlight"å>`
:`</div></demo-block>\n`;
}
}
]
[require('markdown-it-container'), 'demo']
],
preprocess: function(MarkdownIt, source) {
preprocess(MarkdownIt, source) {
const styleRegexp = /<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/i;
const scriptRegexp = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/i;
MarkdownIt.renderer.rules.table_open = () => '<table class="zan-doc-table">';
return source;
return source.replace(styleRegexp, '').replace(scriptRegexp, '');
}
}
}
@@ -143,7 +129,8 @@ module.exports = {
}),
new webpack.optimize.CommonsChunkPlugin({
name: 'vendor',
minChunks: 2
minChunks: 2,
filename: isProduction ? 'vendor.[hash:8].js' : 'vendor.js'
}),
new webpack.HotModuleReplacementPlugin(),
new OptimizeCssAssetsPlugin(),