-
Notifications
You must be signed in to change notification settings - Fork 9
/
webpack.pages-config.js
56 lines (54 loc) · 1.33 KB
/
webpack.pages-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
const path = require('path');
const webpack = require('webpack');
const childProcess = require('child_process');
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
let commitHash = childProcess.execSync('git rev-parse --short HEAD').toString();
module.exports = {
mode: 'production',
entry: {
landing: './deployment/scripts/landing.ts',
editor: './deployment/scripts/editor.ts',
dashboard: './deployment/scripts/dashboard.ts',
},
output: {
path: path.resolve(__dirname, 'dist', 'Neon', 'Neon-gh'),
filename: '[name].js',
},
node: {
fs: 'empty',
},
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.tsx?$/,
use: ['ts-loader'],
exclude: /node_modules/,
},
{
test: /Worker\.js$/,
use: [
{
loader: 'worker-loader',
options: { publicPath: '/Neon/Neon-gh/' },
},
],
},
],
},
resolve: {
extensions: ['.ts', '.js'],
},
externals: {
'verovio-dev': 'verovio',
d3: 'd3',
},
plugins: [
new HardSourceWebpackPlugin(),
new webpack.DefinePlugin({
__LINK_LOCATION__: JSON.stringify('https://ddmal.music.mcgill.ca/Neon'),
__NEON_VERSION__: JSON.stringify(commitHash),
__ASSET_PREFIX__: JSON.stringify('/Neon/Neon-gh/'),
}),
],
};