forked from MorpheusAIs/Lite-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.main.config.ts
58 lines (54 loc) · 1.54 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
57
58
/* eslint-disable import/default */
/* eslint-disable @typescript-eslint/no-var-requires */
import type { Configuration } from 'webpack';
import CopyWebpackPlugin from 'copy-webpack-plugin';
const WebpackPermissionsPlugin = require('webpack-permissions-plugin');
import path from 'path';
import { rules } from './webpack.rules';
import { plugins } from './webpack.plugins';
const devPlugins = [
...plugins,
new CopyWebpackPlugin({
patterns: [
{
from: path.join(__dirname, 'src/executables'), to: path.join(__dirname, '.webpack/executables'),
force: true
}
],
}),
new WebpackPermissionsPlugin({
buildFolders: [
{
path: path.resolve(__dirname, '.webpack/executables'),
fileMode: '755',
dirMode: '644'
}
],
buildFiles: [
{ path: path.resolve(__dirname, '.webpack/executables/ollama.exe'), fileMode: '755' },
{ path: path.resolve(__dirname, '.webpack/executables/ollama-darwin'), fileMode: '755' },
{ path: path.resolve(__dirname, '.webpack/executables/ollama-linux'), fileMode: '755' },
]
})
];
export const mainConfig: Configuration = {
entry: './src/backend/index.ts',
module: {
rules,
},
plugins: [...plugins],
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'],
},
};
export const mainDevConfig: Configuration = {
mode: 'development',
entry: './src/backend/index.ts',
module: {
rules,
},
plugins: [...devPlugins],
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'],
},
};