-
Notifications
You must be signed in to change notification settings - Fork 9
/
webpack.dev.config.js
65 lines (63 loc) · 1.43 KB
/
webpack.dev.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
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: 'development',
target: 'web',
entry: {
landing: './deployment/scripts/landing.ts',
editor: './deployment/scripts/editor.ts',
dashboard: './deployment/scripts/dashboard.ts',
},
output: {
path: path.resolve(__dirname, 'deployment', 'server', 'Neon-gh'),
publicPath: '/',
filename: '[name].js'
},
node: {
fs: 'empty'
},
devtool: 'inline-source-map',
devServer: {
static: './deployment/server',
hot: true,
},
watch: true,
module: {
rules: [
{
test: /\.tsx?$/,
use: [
'ts-loader'
],
exclude: /node_modules/
},
{
test: /Worker\.js$/,
use: [
{
loader: 'worker-loader',
options: { publicPath: '/Neon-gh/' }
}
]
}
]
},
resolve: {
extensions: [ '.ts', '.js' ]
},
externals: {
'verovio-dev': 'verovio',
d3: 'd3'
},
plugins: [
new HardSourceWebpackPlugin(),
new webpack.DefinePlugin({
__LINK_LOCATION__: JSON.stringify('/'),
__NEON_VERSION__: JSON.stringify(commitHash),
__ASSET_PREFIX__: JSON.stringify('/Neon-gh/')
})
]
};