mirror of
https://github.com/twitter/twemoji.git
synced 2025-01-27 15:35:19 +00:00
Generate code to use the current version as the base URL
This commit is contained in:
parent
635dfd8f32
commit
3ddfb2ac3b
@ -10,6 +10,7 @@ var http = require('http');
|
|||||||
var path = require('path');
|
var path = require('path');
|
||||||
var Utils = require('./utils');
|
var Utils = require('./utils');
|
||||||
var regex = require('twemoji-parser/dist/lib/regex').default;
|
var regex = require('twemoji-parser/dist/lib/regex').default;
|
||||||
|
var { version } = require('../package.json');
|
||||||
|
|
||||||
function file(which) {
|
function file(which) {
|
||||||
return path.join(__dirname, '..', which);
|
return path.join(__dirname, '..', which);
|
||||||
@ -46,7 +47,7 @@ function createTwemoji() {
|
|||||||
/////////////////////////
|
/////////////////////////
|
||||||
|
|
||||||
// default assets url, by default will be Twitter Inc. CDN
|
// default assets url, by default will be Twitter Inc. CDN
|
||||||
base: 'https://twemoji.maxcdn.com/v/latest/',
|
base: 'https://twemoji.maxcdn.com/v/$VERSION/',
|
||||||
|
|
||||||
// default assets file extensions, by default '.png'
|
// default assets file extensions, by default '.png'
|
||||||
ext: '.png',
|
ext: '.png',
|
||||||
@ -592,6 +593,7 @@ function createTwemoji() {
|
|||||||
.replace(/^ /gm, '')
|
.replace(/^ /gm, '')
|
||||||
// add the RegExp in the right place
|
// add the RegExp in the right place
|
||||||
.replace('re = /twemoji/', `re = ${regex.toString()}`)
|
.replace('re = /twemoji/', `re = ${regex.toString()}`)
|
||||||
|
.replace('$VERSION', version)
|
||||||
// add the full license
|
// add the full license
|
||||||
.replace('/*! (C) Twitter Inc. */',
|
.replace('/*! (C) Twitter Inc. */',
|
||||||
'/*! (C) Twitter Inc. *//*\n' +
|
'/*! (C) Twitter Inc. *//*\n' +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user