-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
61 lines (60 loc) · 1.81 KB
/
webpack.config.js
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
const TerserPlugin = require('terser-webpack-plugin');
const path = require('path');
module.exports = {
mode: 'production',
entry: './src/index.ts', // 프로젝트의 엔트리 파일
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'index.js', // 출력 파일
library: {
type: 'umd', // UMD 포맷 사용
name: 'EntryVideoLegacy', // 전역 변수로 접근 가능한 라이브러리 이름 (선택적)
export: 'default',
umdNamedDefine: true, // AMD 환경에서도 이름이 있는 AMD 모듈로 정의
},
globalObject: 'this', // 유니버설 모듈 정의에 사용될 글로벌 객체
},
resolve: {
fallback: {
fs: false,
path: false,
crypto: false,
buffer: false,
perf_hooks: false,
},
extensions: ['.ts', '.tsx', '.js', '.json'],
mainFields: ['jsnext:main', 'browser', 'main'],
},
module: {
rules: [
{
test: /\.worker\.ts$/,
use: {
loader: 'worker-loader',
options: {
inline: 'no-fallback',
},
},
},
{
test: /\.ts$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
transpileOnly: true, // 타입 체크 무시
},
},
],
},
resolve: {
extensions: ['.ts', '.js'], // .ts 파일도 해석
},
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
extractComments: false, // 라이선스 파일 추출 비활성화
}),
],
},
};