-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.ts
More file actions
31 lines (27 loc) · 913 Bytes
/
Copy pathwebpack.config.ts
File metadata and controls
31 lines (27 loc) · 913 Bytes
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
import webpack from 'webpack';
import path from 'path';
import { buildWebpack } from './config/build/buildWebpack';
import { BuildMode, BuildPaths, BuildPlatform } from './config/build/types/types';
interface EnvVariables {
mode?: BuildMode;
port?: number;
analyzer?: boolean;
platform?: BuildPlatform;
}
export default (env:EnvVariables)=>{
const paths: BuildPaths={
output: path.resolve(__dirname,'build'),
entry: path.resolve(__dirname, 'src','index.tsx'),
html:path.resolve(__dirname, 'public','index.html'),
src:path.resolve(__dirname, 'src'),
public: path.resolve(__dirname, 'public'),
}
const config:webpack.Configuration= buildWebpack({
port: env.port ?? 3000,
analyzer: env.analyzer,
mode: env.mode ?? "development",
paths: paths,
platform: env.platform ?? 'desktop',
})
return config;
};