-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack-pmu-picker.config.js
78 lines (70 loc) · 2.26 KB
/
webpack-pmu-picker.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
71
72
73
74
75
76
77
78
const HtmlWebPackPlugin = require("html-webpack-plugin");
const path = require('path');
module.exports = {
entry: ['babel-polyfill', path.resolve(__dirname, 'src/pmuMeasPicker/pmuMeasPicker.tsx')],
output: {
filename: "pmu-picker-bundle.js"
},
// Enable sourcemaps for debugging webpack's output.
devtool: "source-map",
target: 'electron-renderer',
module: {
rules: [
{
test: /\.tsx?$/,
include: /src/,
use: ["babel-loader", "ts-loader"]
},
{
test: /\.(js|jsx)$/,
include: /src/,
use: {
loader: "babel-loader"
}
},
{
test: /\.html$/,
include: /src/,
use: {
loader: "html-loader"
}
},
{
test: /\.css$/,
include: path.resolve(__dirname, 'src/pmuMeasPicker/css'),
loader: 'file-loader?name=css/[name].[ext]'
},
{
test: /\.css$/,
include: /src/,
exclude: path.resolve(__dirname, 'src/pmuMeasPicker/css'),
use: ["style-loader", "css-loader"]
},
{
test: /\.png$/,
include: path.resolve(__dirname, 'src/pmuMeasPicker/images'),
loader: 'file-loader?name=images/[name].[ext]'
},
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{
enforce: "pre",
test: /\.js$/,
loader: "source-map-loader"
}
]
},
plugins: [
new HtmlWebPackPlugin({
template: path.resolve(__dirname, 'src/pmuMeasPicker/pmuMeasPicker.html'),
filename: './pmuMeasPicker.html'
})
],
externals: {
// don't bundle the 'react' npm package with our bundle.js, but get it from a global 'React' variable
// for this, use the script tag so in index.html to get the React variable
// jquery: 'jQuery'
},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
}
};