-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.main.config.ts
56 lines (54 loc) · 1.77 KB
/
webpack.main.config.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
49
50
51
52
53
54
55
56
import type { Configuration } from 'webpack';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import { join, resolve } from 'node:path'
import { rules } from './webpack.rules';
export const mainConfig: Configuration = {
cache: false,
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: './src/index.ts',
// Put your normal webpack config below here
module: {
rules,
},
// [solve] active-win > node-pre-gyp [deps]
externals: ['nock', 'mock-aws-s3', 'aws-sdk'],
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'],
alias: {
"@backend": join(__dirname, './src/backend'),
"@config": join(__dirname, './src/config'),
"@services": join(__dirname, './src/services'),
"@modules": join(__dirname, './src/modules'),
"@database": join(__dirname, './src/database'),
"@typed": join(__dirname, './src/typed.ts'),
}
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: resolve(__dirname, 'src', 'database', 'migrations'),
to: resolve(__dirname, '.webpack/main', 'migrations')
},
{
from: resolve(__dirname, '.tessdata', 'eng.traineddata'),
to: resolve(__dirname, '.webpack/main', 'eng.traineddata')
},
// {
// from: resolve(__dirname, '.tessdata', 'mw2.traineddata'),
// to: resolve(__dirname, '.webpack/main', 'mw2.traineddata')
// },
{
from: resolve(__dirname, 'node_modules/tesseract.js-core/tesseract-core-simd.wasm'),
to: resolve(__dirname, '.webpack/main', 'tesseract-core-simd.wasm')
}
]
})
],
experiments: {
asyncWebAssembly: true
}
};