forked from xdan/jodit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathextra-typescript.ts
48 lines (45 loc) · 983 Bytes
/
extra-typescript.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
import type { Variables } from '../variables';
import type { RuleSetRule } from 'webpack';
import * as path from 'path';
export default ({
ESModern,
ES,
dirname,
fat,
superDirname
}: Variables): RuleSetRule => {
return {
test: /\.(js|ts)$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true,
allowTsInNodeModules: true,
compilerOptions: {
allowJs: true,
target: ES,
skipLibCheck: true
}
}
},
{
loader: path.resolve(
superDirname,
'./tools/loaders/process-sections.ts'
),
options: {
POLYFILLS: !ESModern,
FAT: fat
}
}
],
include: [path.resolve(dirname, './node_modules/')],
exclude: [path.resolve(superDirname, './src/langs/')]
};
};