Skip to content

Commit e856400

Browse files
committed
Add client bundles
1 parent cab724d commit e856400

7 files changed

Lines changed: 400 additions & 6 deletions

File tree

rollup.config.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import typescript from '@rollup/plugin-typescript';
2+
3+
export default [
4+
{
5+
input: 'src/bundle/safe.ts',
6+
output: {
7+
format: 'iife',
8+
name: "safeEyo",
9+
file: './dist/bundle.safe.js'
10+
},
11+
plugins: [typescript({ tsconfig: './tsconfig.json' })]
12+
},
13+
{
14+
input: 'src/bundle/notSafe.ts',
15+
output: {
16+
format: 'iife',
17+
name: "notSafeEyo",
18+
file: './dist/bundle.notSafe.js'
19+
},
20+
plugins: [typescript({ tsconfig: './tsconfig.json' })]
21+
}
22+
];

src/bundle/notSafe.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Eyo } from '../eyo';
2+
import { notSafeDictionary } from '../notSafeDictionary';
3+
4+
declare global {
5+
interface Window {
6+
notSafeEyo: Eyo;
7+
}
8+
}
9+
10+
const notSafeEyo = new Eyo();
11+
notSafeEyo.dictionary.set(notSafeDictionary);
12+
13+
export default notSafeEyo;

src/bundle/safe.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Eyo } from '../eyo';
2+
import { safeDictionary } from '../safeDictionary';
3+
4+
declare global {
5+
interface Window {
6+
safeEyo: Eyo;
7+
}
8+
}
9+
10+
const safeEyo = new Eyo();
11+
safeEyo.dictionary.set(safeDictionary);
12+
13+
export default safeEyo;

src/eyo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Dictionary } from './dictionary';
22

3-
const PUNCTUATION = '[{}()[\\]|<>=\\_"\'«»„“#$^%&*+-:;.,?!]';
4-
const REG_EXP = new RegExp('([А-ЯЁа-яё])[а-яё]+(?![а-яё]|\\.[ \u00A0\t]+([а-яё]|[А-ЯЁ]{2}|' +
3+
const PUNCTUATION = '[{}()|<>=_"\'«»„“#$^%&*+:;,?!\u2011\\-[\\]]';
4+
const REG_EXP = new RegExp('([А-ЯЁа-яё])[а-яё]+(?!\\.[ \u00A0\t]+([а-яё]|[А-ЯЁ]{2}|' +
55
PUNCTUATION + ')|\\.' +
66
PUNCTUATION + ')', 'g');
77

0 commit comments

Comments
 (0)