-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathrstack.config.ts
More file actions
104 lines (99 loc) · 2.24 KB
/
Copy pathrstack.config.ts
File metadata and controls
104 lines (99 loc) · 2.24 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// Configuration guide: https://rstack.rs/config
import { define } from 'rstack';
define.lib({
lib: [
{
id: 'server',
syntax: 'es2023',
dts: {
bundle: {
bundledPackages: [
'chokidar',
'readdirp',
'connect-next',
'ws',
'@types/ws',
],
},
},
source: {
define: {
// `ws` internal env vars
'process.env.WS_NO_BUFFER_UTIL': true,
'process.env.WS_NO_UTF_8_VALIDATE': true,
},
},
output: {
externals: {
selfsigned: 'commonjs selfsigned',
},
},
},
{
id: 'client',
syntax: 'es2015',
bundle: false,
source: {
entry: {
index: './client-src/**',
},
define: {
// use define to avoid compile time evaluation of __webpack_hash__
BUILD_HASH: '__webpack_hash__',
RESOURCE_QUERY: '__resourceQuery',
},
tsconfigPath: './tsconfig.client.json',
},
dts: true,
output: {
distPath: './client',
},
},
],
});
define.test({
extends: {},
globals: true,
include: ['tests/*.test.ts', 'tests/e2e/*.test.js'],
exclude: [
// TODO: check why this test timeout
'<rootDir>/tests/e2e/host.test.js',
// TODO: check why this test throw error when run with other tests
'<rootDir>/tests/e2e/watch-files.test.js',
// TODO: check why this test timeout
'<rootDir>/tests/e2e/web-socket-server-url.test.js',
],
pool: {
maxWorkers: '80%',
},
env: {
FORCE_COLOR: 'true',
},
testTimeout: process.env.CI ? 120000 : 60000,
hookTimeout: 60000,
setupFiles: ['./tests/helpers/setup-test.js'],
reporters: ['default'],
});
define.fmt({
singleQuote: true,
});
define.staged({
'*.{js,jsx,ts,tsx,mjs,cjs}': ['rs lint --fix', 'rs fmt'],
'*.{json,json5,md,yaml,yml}': 'rs fmt',
});
define.lint(({ js, ts }) => [
js.configs.recommended,
ts.configs.recommended,
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['tests/**/*'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
},
},
]);