-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
43 lines (41 loc) · 1.18 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
const path = require("path");
var webpack = require("webpack");
var PACKAGE = require("./package.json");
var banner = `${PACKAGE.name} v${PACKAGE.version} (${PACKAGE.homepage})
Copyright 2021-${new Date().getFullYear()} The Kapseli Authors (https://github.com/Stingy-Developer/Kapseli-UI-Framework/graphs/contributors)
Licensed under ${
PACKAGE.license
} (https://github.com/Stingy-Developer/Kapseli-UI-Framework/blob/main/LICENSE)`;
module.exports = {
entry: "./src/index.ts",
output: {
path: path.resolve(__dirname, "dist/bundle"),
filename: "bundle.js",
library: {
name: "Kapseli",
type: "var",
export: "default",
},
},
module: {
rules: [
{
test: /\.js$/, //using regex to tell babel exactly what files to transcompile
exclude: /node_modules/, // files to be ignored
use: {
loader: "babel-loader", // specify the loader
},
},
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
],
},
watch: true,
plugins: [new webpack.BannerPlugin(banner)],
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
};