-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
63 lines (62 loc) · 1.52 KB
/
webpack.config.js
File metadata and controls
63 lines (62 loc) · 1.52 KB
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
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const WebpackNotifierPlugin = require('webpack-notifier')
const CopyPlugin = require('copy-webpack-plugin')
module.exports = {
devServer: {
historyApiFallback: true,
host: process.env.HOST, // Defaults to `localhost`
open: true, // Open the page in browser
overlay: true,
port: process.env.PORT, // Defaults to 8080
publicPath: '/',
stats: 'errors-only', // Display only errors to reduce the amount of output.
},
entry: './src/index.tsx',
module: {
rules: [
{
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
loader: 'ts-loader',
},
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.(jpe?g|gif|png|svg|woff|ttf|wav|mp3)$/i,
exclude: /node_modules/,
loader: 'file-loader',
},
{
test: /\.html$/,
exclude: /node_modules/,
loader: 'html-loader',
},
],
},
output: {
filename: 'index.bundle.js',
path: path.resolve('./build'),
publicPath: './',
},
performance: {
hints: false,
},
plugins: [
new HtmlWebpackPlugin({
title: 'Airstream Account Linking',
template: './src/index.html',
filename: './index.html',
}),
new CopyPlugin({
patterns: [{ from: './assets/**/*' }],
}),
new WebpackNotifierPlugin(),
],
resolve: {
extensions: ['*', '.js', '.jsx', '.ts', '.tsx'],
},
}