-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
42 lines (35 loc) · 1.21 KB
/
webpack.config.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
const webpack = require('webpack')
const path = require('path');
module.exports = {
// put sourcemaps inline
devtool: 'eval',
// entry point of our application, within the `src` directory (which we add to resolve.modules below):
entry: [
'index.tsx'
],
// configure the output directory and publicPath for the devServer
output: {
filename: 'app.js',
publicPath: 'dist',
path: path.resolve('dist')
},
// configure the dev server to run
devServer: {
port: 3000,
historyApiFallback: true,
inline: true,
},
// tell Webpack to load TypeScript files
resolve: {
// Look for modules in .ts(x) files first, then .js
extensions: ['.ts', '.tsx', '.js'],
// add 'src' to the modules, so that when you import files you can do so with 'src' as the relative route
modules: ['src', 'node_modules'],
},
module: {
loaders: [
// .ts(x) files should first pass through the Typescript loader, and then through babel
{ test: /\.tsx?$/, loaders: ['babel-loader', 'ts-loader?' + JSON.stringify({ignoreDiagnostics:[2345, 2307]})], include: path.resolve('src') }
]
},
};