diff --git a/plugins/babel-plugin-canyon/package.json b/plugins/babel-plugin-canyon/package.json index 0853598b..a9bbda25 100644 --- a/plugins/babel-plugin-canyon/package.json +++ b/plugins/babel-plugin-canyon/package.json @@ -1,6 +1,6 @@ { "name": "babel-plugin-canyon", - "version": "2.0.0-beta.21", + "version": "2.0.0-beta.22", "description": "", "scripts": { "release": "babel src --extensions \".ts\" --out-dir lib", diff --git a/plugins/babel-plugin-canyon/src/index.ts b/plugins/babel-plugin-canyon/src/index.ts index 78b2b652..b39d58ae 100644 --- a/plugins/babel-plugin-canyon/src/index.ts +++ b/plugins/babel-plugin-canyon/src/index.ts @@ -1,8 +1,11 @@ import {declare} from "@babel/helper-plugin-utils"; import {visitorProgramExit} from "./visitor-program-exit"; import {template} from "@babel/core"; -import tep from './template' +import tep from './template'; +import packageJson from '../package.json' const writeCanyonToLocalTemplate = template(tep["templates/write-canyon-to-local-template.js"]) + + export default declare((api, config, dirname) => { api.assertVersion(7); return { @@ -16,6 +19,7 @@ export default declare((api, config, dirname) => { const servePa:{provider?:string,compareTarget?:string}&any = { ...config, + version: packageJson.version, projectID: config.projectID || env_projectID || '-', sha: config.sha || env_sha || '-', branch: config.branch || env_branch || '-', diff --git a/plugins/babel-plugin-canyon/test-babel-config.js b/plugins/babel-plugin-canyon/test-babel-config.js index 90a37565..038052b4 100644 --- a/plugins/babel-plugin-canyon/test-babel-config.js +++ b/plugins/babel-plugin-canyon/test-babel-config.js @@ -17,7 +17,7 @@ module.exports = { oneByOne: true, //可配置代理 默认false special: true, //默认false keepMap: true, // 默认false - addAttributes:['branch'], //默认全部,有的话用有的,适用于生产 + // addAttributes:['branch'], //默认全部,有的话用有的,适用于生产 }] ] }