mirror of
https://github.com/twitter/twemoji.git
synced 2025-04-15 14:42:37 +00:00
fix: temporary fix MaxCDN outage (#581)
* fix: temporary fix * fix: update yarn command line in build script
This commit is contained in:
parent
ad3d3d669b
commit
abb5a1add2
7
.gitignore
vendored
7
.gitignore
vendored
@ -3,3 +3,10 @@ node_modules/
|
|||||||
build
|
build
|
||||||
dist/
|
dist/
|
||||||
.npmrc
|
.npmrc
|
||||||
|
.yarn/*
|
||||||
|
!.yarn/cache
|
||||||
|
!.yarn/patches
|
||||||
|
!.yarn/plugins
|
||||||
|
!.yarn/releases
|
||||||
|
!.yarn/sdks
|
||||||
|
!.yarn/versions
|
1
.yarnrc.yml
Normal file
1
.yarnrc.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
nodeLinker: node-modules
|
@ -22,7 +22,7 @@ This guarantees that you will always use the latest version of the library.
|
|||||||
|
|
||||||
If, instead, you'd like to include the latest version explicitly, you can add the following tag:
|
If, instead, you'd like to include the latest version explicitly, you can add the following tag:
|
||||||
```html
|
```html
|
||||||
<script src="https://twemoji.maxcdn.com/v/14.0.2/twemoji.min.js" integrity="sha384-32KMvAMS4DUBcQtHG6fzADguo/tpN1Nh6BAJa2QqZc6/i0K+YPQE+bWiqBRAWuFs" crossorigin="anonymous"></script>
|
<script src="https://unpkg.com/twemoji@14.0.2/dist/twemoji.min.js" integrity="sha384-ICOlZarapRIX6UjKPcWKEpubjg7lGADN7Y9fYP4DU9zm0aPFhgnP5ef+XFaPyKv+" crossorigin="anonymous"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Download
|
### Download
|
||||||
|
2
index.d.ts
vendored
2
index.d.ts
vendored
@ -13,7 +13,7 @@ export type ReplacerFunction = (substring: string, ...args: any[]) => string;
|
|||||||
|
|
||||||
export type TwemojiOptions = {
|
export type TwemojiOptions = {
|
||||||
/**
|
/**
|
||||||
* Default: MaxCDN
|
* Default: Cloudflare
|
||||||
*/
|
*/
|
||||||
base?: string;
|
base?: string;
|
||||||
/**
|
/**
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
|
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
|
||||||
|
|
||||||
<p>Code licensed under MIT. Graphics licensed under CC-BY</p>
|
<p>Code licensed under MIT. Graphics licensed under CC-BY</p>
|
||||||
<script src="https://twemoji.maxcdn.com/v/latest/twemoji.min.js"></script>
|
<script src="https://unpkg.com/twemoji@latest/dist/twemoji.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// I \u2764 emoji!
|
// I \u2764 emoji!
|
||||||
twemoji.parse(document.body);
|
twemoji.parse(document.body);
|
||||||
|
@ -47,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/$VERSION/',
|
base: 'https://cdnjs.cloudflare.com/ajax/libs/twemoji/$VERSION/',
|
||||||
|
|
||||||
// default assets file extensions, by default '.png'
|
// default assets file extensions, by default '.png'
|
||||||
ext: '.png',
|
ext: '.png',
|
||||||
|
@ -39,7 +39,7 @@ fs.writeFileSync(
|
|||||||
);
|
);
|
||||||
|
|
||||||
spawnSync(
|
spawnSync(
|
||||||
'yarnpkg',
|
'yarn',
|
||||||
[
|
[
|
||||||
'uglifyjs',
|
'uglifyjs',
|
||||||
'--verbose',
|
'--verbose',
|
||||||
@ -60,7 +60,7 @@ const integrityHash = getIntegrityHash(distFile('twemoji.min.js'));
|
|||||||
const { version } = require('../package.json');
|
const { version } = require('../package.json');
|
||||||
|
|
||||||
function updateSriScriptReference(filename) {
|
function updateSriScriptReference(filename) {
|
||||||
const newScript = `<script src="https://twemoji.maxcdn.com/v/${version}/twemoji.min.js" integrity="${integrityHash}"`;
|
const newScript = `<script src="https://unpkg.com/twemoji@${version}/dist/twemoji.min.js" integrity="${integrityHash}"`;
|
||||||
fs.writeFileSync(filename, fs.readFileSync(filename).toString('utf8').replace(/<script src="[^ ]*" integrity="[^ ]*"/, newScript));
|
fs.writeFileSync(filename, fs.readFileSync(filename).toString('utf8').replace(/<script src="[^ ]*" integrity="[^ ]*"/, newScript));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
vertical-align: -0.1em;
|
vertical-align: -0.1em;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="https://twemoji.maxcdn.com/v/latest/twemoji.min.js" crossorigin="anonymous"></script>
|
<script src="https://unpkg.com/twemoji@latest/dist/twemoji.min.js" crossorigin="anonymous"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<ul class="emoji-list">
|
<ul class="emoji-list">
|
||||||
|
@ -225,7 +225,7 @@ wru.test([{
|
|||||||
},{
|
},{
|
||||||
name: 'nested nodes',
|
name: 'nested nodes',
|
||||||
test: function () {
|
test: function () {
|
||||||
var str = '<img class="emoji" draggable="false" alt="\u2764" src="https://twemoji.maxcdn.com/72x72/2764.png"/>',
|
var str = '<img class="emoji" draggable="false" alt="\u2764" src="https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/72x72/2764.png"/>',
|
||||||
div = document.createElement('div'),
|
div = document.createElement('div'),
|
||||||
p,
|
p,
|
||||||
img;
|
img;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user