-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.ts
33 lines (29 loc) · 1.11 KB
/
webpack.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
import { BuildEnv, BuildPaths } from './config/build/types/config';
import path from 'path';
import webpack from 'webpack';
import { buildWebpackConfig } from './config/build/buildWebpackConfig';
export default (env: BuildEnv) => {
const paths: BuildPaths = {
entry: path.resolve(__dirname, 'src', 'index.tsx'),
build: path.resolve(__dirname, 'build'),
html: path.resolve(__dirname, 'public', 'index.html'),
ico: path.resolve(__dirname, 'public', 'favicon.ico'),
src: path.resolve(__dirname, 'src'),
locales: path.resolve(__dirname, 'src', 'locales'),
buildLocales: path.resolve(__dirname, 'build', 'locales'),
magicSDK: path.resolve(__dirname, 'node_modules/magic-sdk/dist/cjs/index.js'),
dynamicEthersV6: path.resolve(__dirname, 'node_modules/@dynamic-labs/ethers-v6'),
};
const PORT = env.port || 3000;
const mode = env.mode || 'development';
const isDev = mode === 'development';
const isAnalyze = process.env.analyze === '1';
const config: webpack.Configuration = buildWebpackConfig({
mode,
paths,
isDev,
isAnalyze,
port: PORT,
});
return config;
};