-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
61 lines (59 loc) · 1.74 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
const webpack = require("webpack");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
optimization: { minimize: false },
entry: ["whatwg-fetch", "./build/index.js"],
output: {
path: __dirname + "/jupyter_euporie/static",
filename: "bundle.js",
},
bail: true,
devtool: "cheap-source-map",
mode: "production",
module: {
rules: [
{ test: /\.css$/, use: ["style-loader", "css-loader"] },
{ test: /\.html$/, use: "file-loader" },
{ test: /\.md$/, use: "raw-loader" },
{
// In .css files, svg is loaded as a data URI.
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
issuer: /\.css$/,
use: {
loader: "svg-url-loader",
options: { encoding: "none", limit: 10000 },
},
},
{
// In .ts and .tsx files (both of which compile to .js), svg files
// must be loaded as a raw string instead of data URIs.
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
issuer: /\.js$/,
use: {
loader: "raw-loader",
},
},
{
test: /\.(png|jpg|gif|ttf|woff|woff2|eot)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
use: [{ loader: "url-loader", options: { limit: 10000 } }],
},
],
},
plugins: [
new webpack.DefinePlugin({
// Needed for Blueprint. See https://github.com/palantir/blueprint/issues/4393
"process.env": "{}",
// Needed for various packages using cwd(), like the path polyfill
process: { cwd: () => "/" },
}),
new CopyPlugin({
patterns: [
{
from:
"node_modules/xterm-addon-image/lib/xterm-addon-image-worker.js",
to: __dirname + "/jupyter_euporie/static/xterm-addon-image-worker.js",
},
],
}),
],
};