diff --git a/fis-conf.js b/fis-conf.js index 5b1f73bd0..f19878c5f 100644 --- a/fis-conf.js +++ b/fis-conf.js @@ -2,6 +2,7 @@ * @file fis-conf.js 配置 */ const path = require('path'); +const package = require('./package.json'); const parserMarkdown = require('./build/md-parser'); fis.get('project.ignore').push( 'public/**', @@ -62,6 +63,12 @@ fis.match('/docs/**.md', { isMod: true }); +fis.on('compile:parser', function (file) { + if (file.subpath === '/src/index.tsx') { + file.setContent(file.getContent().replace('@version', package.version)); + } +}); + fis.match('{*.ts,*.jsx,*.tsx,/src/**.js,/src/**.ts}', { parser: [fis.plugin('typescript', { importHelpers: true, diff --git a/src/index.tsx b/src/index.tsx index 0613716a0..465853286 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,8 +1,10 @@ -/** - * @file 文件入口 - * @author fex +/** @license amis v@version + * + * Copyright Baidu + * + * This source code is licensed under the Apache license found in the + * LICENSE file in the root directory of this source tree. */ - import {render, Renderer, getRendererByName, resolveRenderer, filterSchema} from './factory'; import {wrapFetcher, buildApi} from './utils/api'; import {filter, reigsterTplEnginer} from './utils/tpl'