-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.common.js
45 lines (43 loc) · 1.35 KB
/
webpack.common.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
45
function commonConfig() {
return {
devtool: "source-map",
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: ["*", ".webpack.js", ".web.js", ".ts", ".tsx", ".js"]
},
module: {
rules: [
// All files with a '.ts' extension will be handled by 'awesome-typescript-loader'.
// and then fed through Babel to compiled from ES6 to ES5
{
test: /\.ts$/,
loaders: [
{
loader: "awesome-typescript-loader",
options: {
useBabel: true,
useCache: true
}
}
],
exclude: [/node_modules/]
},
{
enforce: 'pre',
test: /\.js$/,
loader: "source-map-loader"
},
{
test: /\.(html)|(png)|(css)|(svg)$/,
loader: "file-loader",
options: {
name: "[name].[ext]"
}
}
]
}
}
}
module.exports = {
commonConfig: commonConfig
};