mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 10:44:59 +00:00
[new feature] add i18n support (#310)
* fix: Tabbar icon line-height * [new feature] progress add showPivot prop * [new feature] TabItem support vue-router * [new feature] update document header style * [Doc] add toast english ducoment * [new feature] add i18n support * feat: Extract demos from markdown * feat: Base components demos * [new feature] complete demo extract & translate * [fix] text cases * fix: add deepAssign test cases * fix: changelog detail * [new feature] AddressEdit support i18n
This commit is contained in:
@@ -6,20 +6,11 @@ const ProgressBarPlugin = require('progress-bar-webpack-plugin');
|
||||
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
const docConfig = require('../docs/src/doc.config');
|
||||
const { extractExample } = require('zan-doc/src/helper');
|
||||
const styleLoaders = [
|
||||
{ loader: 'css-loader' },
|
||||
{ loader: 'postcss-loader', options: { sourceMap: true } }
|
||||
];
|
||||
|
||||
// extract [components].vue from [components].md
|
||||
extractExample({
|
||||
src: path.resolve(__dirname, '../docs/examples-docs'),
|
||||
dist: path.resolve(__dirname, '../docs/examples-dist'),
|
||||
nav: docConfig,
|
||||
watch: !isProduction
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
entry: {
|
||||
vendor: ['packages'],
|
||||
@@ -89,15 +80,7 @@ module.exports = {
|
||||
test: /\.md/,
|
||||
loader: 'vue-markdown-loader',
|
||||
options: {
|
||||
preventExtract: true,
|
||||
use: [[require('markdown-it-container'), 'demo']],
|
||||
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.replace(styleRegexp, '').replace(scriptRegexp, '');
|
||||
}
|
||||
preventExtract: true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user