-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
44 lines (41 loc) · 1.25 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
43
44
var webpack = require('webpack');
var filename = "bundle.js";
var entry = "./src/index.tsx";
var plugins =
[
new webpack.optimize.ModuleConcatenationPlugin()
];
module.exports = function () {
filename = "bundle/sample.js";
return {
entry: entry,
output: {
filename: filename,
libraryTarget: "umd"
},
// Enable sourcemaps for debugging webpack's output.
devtool: "source-map",
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: [".webpack.js", ".web.js", ".ts", ".tsx", ".js"]
},
plugins: plugins,
module: {
rules: [
// All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'.
{
test: /\.ts(x?)$/,
use: ['ts-loader'],
exclude: /node_modules/
},
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{
test: /\.js$/,
use: ["source-map-loader"],
exclude: /node_modules/,
enforce: "pre"
}
]
}
}
}