-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.common.js
More file actions
39 lines (38 loc) · 978 Bytes
/
webpack.common.js
File metadata and controls
39 lines (38 loc) · 978 Bytes
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
/**
* Common Webpack's configuration file, to hold common configurations for production and development.
* See options https://webpack.js.org/configuration/.
*/
const path = require('path');
module.exports = {
/*
* Defaults to ./src
* Here the application starts executing and webpack starts bundling.
*/
entry: path.resolve(`${__dirname}/src/index.tsx`),
// Options related to how webpack emits results.
output: {
path: path.resolve(`${__dirname}/public`),
filename: 'bundle.js'
},
// Options for resolving module requests
resolve: {
extensions: ['.tsx', '.ts', '.js', '.css'],
},
module: {
rules: [
{
test: /\.(ts|tsx)?/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.jpe?g$|\.gif$|\.png$|\.svg$|\.woff$|\.woff2$|\.ttf$|\.eot$/,
loader: 'url-loader',
},
],
}
};