-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.js
46 lines (45 loc) · 1.02 KB
/
webpack.common.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
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const TSLintPlugin = require("tslint-webpack-plugin");
module.exports = {
entry: "./src/app.ts",
output: {
path: path.resolve("build"),
filename: "[name].js"
},
stats: "minimal",
plugins: [
new CleanWebpackPlugin(["build"]),
new MiniCssExtractPlugin(),
new HtmlWebpackPlugin({
template: "./src/index.html",
hash: true
}),
new TSLintPlugin({
files: ["./src/**/*.ts"]
})
],
resolve: {
modules: [path.resolve("node_modules")],
extensions: [".ts", ".js"]
},
module: {
rules: [
{
test: /\.ts$/,
include: path.resolve("src"),
use: "ts-loader"
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, "css-loader"]
},
{
test: /\.png$/,
use: "file-loader"
}
]
}
};