-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
56 lines (51 loc) · 1.45 KB
/
webpack.config.ts
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
import path from 'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { CleanWebpackPlugin } from 'clean-webpack-plugin';
import ZipPlugin from 'zip-webpack-plugin';
module.exports = {
entry: './src/index.tsx',
output: {
path: path.resolve(__dirname, 'build'),
publicPath: '/',
filename: '[name].js',
},
target: 'web',
mode: 'development',
// Enable sourcemaps for debugging webpack's output.
devtool: 'source-map',
devServer: {
port: 8888,
contentBase: './build',
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.mustache', '.html', '.json', '.css'],
},
module: {
rules: [
{
test: /\.ts(x?)$/,
exclude: /node_modules/,
use: ['ts-loader'],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
},
],
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: path.join(__dirname, 'src', 'index.html'),
}),
new ZipPlugin({
// OPTIONAL: defaults to the Webpack output filename (above) or,
// if not present, the basename of the path
filename: 'boilerplate.zip',
}),
],
};