declare var __DEV__: boolean
declare var __JSDOM__: boolean
declare var __BROWSER__: boolean
+declare var __COMMIT__: string
// Feature flags
declare var __FEATURE_OPTIONS__: boolean
setup() {
return () => [
h('h1', `Vue 3 Template Explorer`),
+ h(
+ 'a',
+ {
+ href: `https://github.com/vuejs/vue-next/tree/${__COMMIT__}`,
+ target: `_blank`
+ },
+ `@${__COMMIT__}`
+ ),
h('div', { id: 'options' }, [
// mode selection
h('span', { class: 'options-group' }, [
h1 {
font-size: 18px;
display: inline-block;
+ margin-right: 15px;
}
#options {
margin-right: 30px;
}
-#header span, #header label, #header input {
+#header span, #header label, #header input, #header a {
display: inline-block;
}
+#header a {
+ font-weight: 600;
+ color: rgb(101, 163, 221);
+}
+
#header .label {
font-weight: bold;
}
function createReplacePlugin(isProduction, isBunlderESMBuild, isBrowserBuild) {
return replace({
+ __COMMIT__: `"${process.env.COMMIT}"`,
__DEV__: isBunlderESMBuild
? // preserve to be handled by bundlers
`process.env.NODE_ENV !== 'production'`
const devOnly = args.devOnly || args.d
const prodOnly = !devOnly && (args.prodOnly || args.p)
const buildAllMatching = args.all || args.a
+const commit = execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)
;(async () => {
if (!targets.length) {
await buildAll(allTargets)
[
'-c',
'--environment',
- `NODE_ENV:${env},` +
- `TARGET:${target}` +
- (formats ? `,FORMATS:${formats}` : ``) +
- (args.types ? `,TYPES:true` : ``) +
- (prodOnly ? `,PROD_ONLY:true` : ``)
+ [
+ `COMMIT:${commit}`,
+ `NODE_ENV:${env}`,
+ `TARGET:${target}`,
+ formats ? `FORMATS:${formats}` : ``,
+ args.types ? `TYPES:true` : ``,
+ prodOnly ? `PROD_ONLY:true` : ``
+ ]
+ .filter(_ => _)
+ .join(',')
],
{ stdio: 'inherit' }
)
const args = require('minimist')(process.argv.slice(2))
const target = args._.length ? fuzzyMatchTarget(args._)[0] : 'vue'
const formats = args.formats || args.f
+const commit = execa.sync('git', ['rev-parse', 'HEAD']).stdout.slice(0, 7)
execa(
'rollup',
- ['-wc', '--environment', `TARGET:${target},FORMATS:${formats || 'global'}`],
+ [
+ '-wc',
+ '--environment',
+ [
+ `COMMIT:${commit}`,
+ `TARGET:${target}`,
+ `FORMATS:${formats || 'global'}`
+ ].join(',')
+ ],
{
stdio: 'inherit'
}