forked from teamhanko/hanko
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.cjs
101 lines (100 loc) · 2.04 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
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",
},
},
fr: {
filename: "i18n/zh.js",
import: "./src/i18n/zh.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"),
},
};