forked from omegaup/omegaup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config-grader.js
60 lines (58 loc) · 1.33 KB
/
webpack.config-grader.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
const path = require('path');
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
name: 'grader',
entry: {
grader_ephemeral: [
'@babel/polyfill',
'./frontend/www/js/omegaup/grader/ephemeral.js',
],
},
optimization: {},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
},
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/env'],
cacheDirectory: true,
},
},
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.ttf$/,
use: ['file-loader'],
},
],
},
resolve: {
alias: {
vue$: 'vue/dist/vue.common.js',
'vue-async-computed': 'vue-async-computed/dist/vue-async-computed.js',
},
fallback: {
buffer: require.resolve('buffer/'),
stream: require.resolve('stream-browserify'),
},
},
plugins: [new VueLoaderPlugin(), new MonacoWebpackPlugin()],
output: {
path: path.resolve(__dirname, './frontend/www/js/dist/'),
publicPath: '/js/dist/',
filename: '[name].js',
library: '[name]',
libraryTarget: 'umd',
},
};