mirror of
https://github.com/twitter/twemoji.git
synced 2025-01-12 15:40:36 +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 Utils = require('./utils');
|
||||
var regex = require('twemoji-parser/dist/lib/regex').default;
|
||||
var { version } = require('../package.json');
|
||||
|
||||
function file(which) {
|
||||
return path.join(__dirname, '..', which);
|
||||
@ -46,7 +47,7 @@ function createTwemoji() {
|
||||
/////////////////////////
|
||||
|
||||
// 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'
|
||||
ext: '.png',
|
||||
@ -592,6 +593,7 @@ function createTwemoji() {
|
||||
.replace(/^ /gm, '')
|
||||
// add the RegExp in the right place
|
||||
.replace('re = /twemoji/', `re = ${regex.toString()}`)
|
||||
.replace('$VERSION', version)
|
||||
// add the full license
|
||||
.replace('/*! (C) Twitter Inc. */',
|
||||
'/*! (C) Twitter Inc. *//*\n' +
|
||||
|
Loading…
Reference in New Issue
Block a user