forked from EasonLin0716/JS-Modal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
33 lines (31 loc) · 816 Bytes
/
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
const webpack = require("webpack");
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const RemoveEmptyScriptsPlugin = require("webpack-remove-empty-scripts");
const config = {
entry: {
"js-modal": "./scripts/build.ts",
"js-modal.min": "./src/js-modal.css",
},
output: {
path: path.resolve(__dirname, "dist/"),
},
plugins: [new RemoveEmptyScriptsPlugin(), new MiniCssExtractPlugin()],
module: {
rules: [
{
test: /\.css$/i,
use: [MiniCssExtractPlugin.loader, "css-loader"],
},
{
test: /\.ts(x)?$/,
loader: "ts-loader",
exclude: /node_modules/,
},
],
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
};
module.exports = config;