-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwebpack.common.js
59 lines (58 loc) · 1.59 KB
/
webpack.common.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
import CopyPlugin from 'copy-webpack-plugin';
import DotenvWebpackPlugin from 'dotenv-webpack';
import FaviconsWebpackPlugin from 'favicons-webpack-plugin';
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { dirname } from 'path';
import { fileURLToPath } from 'url';
/** @type {import('webpack').Configuration} */
export default {
// https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#installation
context: dirname(fileURLToPath(import.meta.url)),
entry: './src/index',
output: {
publicPath: '/',
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
module: {
rules: [
{
test: /\.[tj]sx?$/i,
exclude: /node_modules/,
use: 'babel-loader',
},
],
},
plugins: [
new DotenvWebpackPlugin({
systemvars: true,
}),
new HtmlWebpackPlugin({
template: 'index.html',
filename: 'index.html',
}),
new FaviconsWebpackPlugin({
logo: './src/assets/icon.svg',
devMode: 'webapp',
persistentCache: true,
favicons: {
icons: {
favicons: false,
yandex: false,
},
appName: '요즘카페',
appDescription: '트렌디한 성수 지역의 카페를 손쉽게 탐색하는 서비스, 요즘카페',
appleStatusBarStyle: '#ffd3d8',
lang: 'ko-KR',
background: '#ffffff',
theme_color: '#ffd3d8',
},
}),
new CopyPlugin({
patterns: [{ from: 'public', to: '' }],
}),
new ForkTsCheckerWebpackPlugin(),
],
};