-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
34 lines (33 loc) · 1.19 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
var webpack = require('webpack');
var path = require('path');
var WebpackNotifierPlugin = require('webpack-notifier');
module.exports = {
devtool: 'eval',
// This will be our app's entry point (webpack will look for it in the 'src' directory due to the modulesDirectory setting below). Feel free to change as desired.
entry: [
'./src/index.tsx'
],
devtool: 'source-map',
// Output the bundled JS to dist/app.js
output: {
filename: 'app.js',
path: path.resolve('dist')
},
resolve: {
// Look for modules in .ts(x) files first, then .js(x)
extensions: ['', '.ts', '.tsx', '.js', '.jsx'],
// Add 'src' to our modulesDirectories, as all our app code will live in there, so Webpack should look in there for modules
modulesDirectories: ['src', 'node_modules'],
},
module: {
loaders: [
// .ts(x) files should first pass through the Typescript loader, and then through babel
// { test: /\.tsx?$/, loaders: ['babel', 'ts-loader'] }
{ test: /\.tsx?$/, loaders: ['ts-loader'] }
]
},
plugins: [
// Set up the notifier plugin - you can remove this (or set alwaysNotify false) if desired
new WebpackNotifierPlugin({ alwaysNotify: true }),
]
};