-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
70 lines (65 loc) · 1.93 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
var path = require('path');
module.exports = {
// Target the output of the typescript compiler
context: path.join(__dirname, "src"),
// File(s) to target
entry: {
template: "./template.tsx",
},
// Output
output: {
// Filename
filename: "jslink_[name].js",
// Folder
path: path.join(__dirname, "dist")
},
// Files to resolve
resolve: {
extensions: [".css", ".js", ".jsx", ".ts", ".tsx"]
},
// Module to define what libraries with the compiler
module: {
// Rules
rules: [
{
// Target the .css files
test: /\.css/,
// Exclude the node modules folder
exclude: /node_modules/,
// Define the compiler to use
use: [
{
// Use the 'style-loader' library
loader: "style-loader"
},
{
// Use the 'css-loader' library
loader: "css-loader"
}
]
},
{
// Target the .ts and .tsx files
test: /\.tsx?$/,
// Exclude the node modules folder
exclude: /node_modules/,
// Define the compiler to use
use: [
{
// Use the 'babel-loader' library
loader: "babel-loader",
// Options
options: {
// Use the 'babel-preset-es2015' library
presets: ["es2015"]
}
},
{
// Use the 'ts-loader' library
loader: "ts-loader"
}
]
}
]
}
};