-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
46 lines (40 loc) · 1.21 KB
/
Copy pathwebpack.config.js
File metadata and controls
46 lines (40 loc) · 1.21 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
const { resolve } = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
devtool: 'eval',
context: resolve(__dirname, 'src'),
entry: [
'react-hot-loader/patch',
'./index.tsx'
],
output: {
filename: 'bundle.js',
path: resolve(__dirname, 'dist'),
publicPath: '/'
},
devServer: {
hot: true,
contentBase: resolve(__dirname, 'dist'),
publicPath: '/',
port: 3000
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new HtmlWebpackPlugin()
],
module: {
rules: [
{ test: /\.tsx?$/, use: ['babel-loader', 'awesome-typescript-loader'], exclude: /node_modules/ },
{ test: /\.css$/, use: [ 'style-loader', 'css-loader', ], },
{ test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, use: "file-loader" },
{ test: /\.(woff|woff2)$/, use:"url-loader?prefix=font/&limit=5000" },
{ test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, use: "url-loader?limit=10000&mimetype=application/octet-stream" },
{ test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, use: "url-loader?limit=10000&mimetype=image/svg+xml" }
],
},
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx']
},
};