-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathwebpack.config.js
65 lines (63 loc) · 2 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
62
63
64
65
import path, { dirname } from "path";
import { fileURLToPath } from "url";
import MiniCssExtractPlugin from "mini-css-extract-plugin";
import CssMinimizerPlugin from "css-minimizer-webpack-plugin";
import TerserJSPlugin from "terser-webpack-plugin";
const __dirname = dirname(fileURLToPath(import.meta.url));
export default {
entry: {
sweetAlert2: "./src/ts/SweetAlert.ts",
"sweetAlert2.min": "./src/ts/SweetAlert.ts",
defaultTheme: "./src/scss/default-theme.scss",
"defaultTheme.min": "./src/scss/default-theme.scss",
darkTheme: "./src/scss/dark-theme.scss",
"darkTheme.min": "./src/scss/dark-theme.scss",
minimalTheme: "./src/scss/minimal-theme.scss",
"minimalTheme.min": "./src/scss/minimal-theme.scss",
borderlessTheme: "./src/scss/borderless-theme.scss",
"borderlessTheme.min": "./src/scss/borderless-theme.scss",
bootstrap4Theme: "./src/scss/bootstrap-4-theme.scss",
"bootstrap4Theme.min": "./src/scss/bootstrap-4-theme.scss",
materialUITheme: "./src/scss/material-ui-theme.scss",
"materialUITheme.min": "./src/scss/material-ui-theme.scss",
wordpressAdminTheme: "./src/scss/wordpress-admin-theme.scss",
"wordpressAdminTheme.min": "./src/scss/wordpress-admin-theme.scss",
bulmaTheme: "./src/scss/bulma-theme.scss",
"bulmaTheme.min": "./src/scss/bulma-theme.scss",
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "wwwroot"),
},
module: {
rules: [
{
test: /\.ts$/,
use: "babel-loader",
exclude: /node_modules/,
},
{
test: /\.(sass|scss)$/,
use: [MiniCssExtractPlugin.loader, "css-loader", "sass-loader"],
exclude: /node_modules/,
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
}),
],
optimization: {
minimizer: [
new TerserJSPlugin({
include: /\.min\.js$/,
}),
new CssMinimizerPlugin(),
],
},
resolve: {
extensions: [".ts", ".scss", ".js"],
},
stats: "normal",
};