-
Notifications
You must be signed in to change notification settings - Fork 940
/
webpack.config.cjs
122 lines (121 loc) · 2.43 KB
/
webpack.config.cjs
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
const path = require("path");
module.exports = {
experiments: {
outputModule: true,
},
entry: {
hankoElements: {
filename: "elements.js",
import: "./src/index.ts",
library: {
type: "module",
},
},
de: {
filename: "i18n/de.js",
import: "./src/i18n/de.ts",
library: {
type: "module",
},
},
en: {
filename: "i18n/en.js",
import: "./src/i18n/en.ts",
library: {
type: "module",
},
},
fr: {
filename: "i18n/fr.js",
import: "./src/i18n/fr.ts",
library: {
type: "module",
},
},
it: {
filename: "i18n/it.js",
import: "./src/i18n/it.ts",
library: {
type: "module",
},
},
ptBR: {
filename: "i18n/pt-BR.js",
import: "./src/i18n/pt-BR.ts",
library: {
type: "module",
},
},
zr: {
filename: "i18n/zh.js",
import: "./src/i18n/zh.ts",
library: {
type: "module",
},
},
bn: {
filename: "i18n/bn.js",
import: "./src/i18n/bn.ts",
library: {
type: "module",
},
},
all: {
filename: "i18n/all.js",
import: "./src/i18n/all.ts",
library: {
type: "module",
},
},
},
module: {
rules: [
{
test: /\.(tsx?)$/,
use: "ts-loader",
exclude: [/node_modules/, /dist/],
resolve: {
fullySpecified: false,
},
},
{
test: /\.(sass)$/,
use: [
{
loader: "style-loader",
options: {
injectType: "singletonStyleTag",
insert: (styleTag) => {
// eslint-disable-next-line no-underscore-dangle
window._hankoStyle = styleTag;
},
},
},
{
loader: "css-loader",
options: {
modules: {
localIdentName: "hanko_[local]",
localIdentContext: path.resolve(__dirname, "src"),
},
importLoaders: 1,
},
},
{
loader: "sass-loader",
options: {
sourceMap: true,
},
},
],
},
],
},
resolve: {
extensions: [".ts", ".tsx", ".js", ".sass", "declarations.d.ts"],
},
output: {
clean: true,
path: path.resolve(__dirname, "dist"),
},
};