-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.gh-pages.js
55 lines (54 loc) · 1.22 KB
/
webpack.config.gh-pages.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
const path = require('path');
const CopyPlugin = require('copy-webpack-plugin');
const webpack = require('webpack');
module.exports = {
entry: {
index: './index.ts',
gridworld_dp: './gridworld_dp/index.ts',
gridworld_td: './gridworld_td/index.ts',
puckworld: './puckworld/index.ts',
waterworld: './waterworld/index.ts',
'lunar-lander': './lunar-lander/index.ts',
},
mode: 'production',
module: {
rules: [
{
test: /\.(tsx|ts)?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.html?$/,
use: 'raw-loader',
exclude: /node_modules/,
},
{
test: /\.css$/i,
use: ["style-loader", "css-loader"],
},
],
},
plugins: [
new CopyPlugin({
patterns: [
{ from: 'index.html', to: 'index.html' },
],
}),
new webpack.ProvidePlugin({
jQuery: 'jquery',
$: 'jquery',
}),
],
resolve: {
extensions: ['.tsx', '.ts', '.js', '.html'],
alias: {
'jQuery': path.resolve(__dirname, './node_modules/jquery/dist/jquery.js'),
}
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, '.gh-pages'),
libraryTarget: 'umd',
},
};