Skip to content

Commit edd15f1

Browse files
Matt HughesDave St.Germain
Matt Hughes
authored and
Dave St.Germain
committed
WIP: currently dev-only approach to proctoring webworker JS API
1 parent 5e62714 commit edd15f1

File tree

6 files changed

+43
-3
lines changed

6 files changed

+43
-3
lines changed

cms/envs/common.py

+4
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,10 @@
881881
'DEFAULT': {
882882
'BUNDLE_DIR_NAME': 'bundles/',
883883
'STATS_FILE': os.path.join(STATIC_ROOT, 'webpack-stats.json')
884+
},
885+
'WORKERS': {
886+
'BUNDLE_DIR_NAME': 'bundles/',
887+
'STATS_FILE': os.path.join(STATIC_ROOT, 'webpack-worker-stats.json')
884888
}
885889
}
886890
WEBPACK_CONFIG_PATH = 'webpack.prod.config.js'

cms/envs/production.py

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
if STATIC_ROOT_BASE:
129129
STATIC_ROOT = path(STATIC_ROOT_BASE) / 'studio'
130130
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = STATIC_ROOT / "webpack-stats.json"
131+
WEBPACK_LOADER['WORKERS']['STATS_FILE'] = STATIC_ROOT / "webpack-worker-stats.json"
131132

132133
EMAIL_BACKEND = ENV_TOKENS.get('EMAIL_BACKEND', EMAIL_BACKEND)
133134
EMAIL_FILE_PATH = ENV_TOKENS.get('EMAIL_FILE_PATH', None)

lms/envs/common.py

+4
Original file line numberDiff line numberDiff line change
@@ -1842,6 +1842,10 @@ def _make_locale_paths(settings):
18421842
'DEFAULT': {
18431843
'BUNDLE_DIR_NAME': 'bundles/',
18441844
'STATS_FILE': os.path.join(STATIC_ROOT, 'webpack-stats.json')
1845+
},
1846+
'WORKERS': {
1847+
'BUNDLE_DIR_NAME': 'bundles/',
1848+
'STATS_FILE': os.path.join(STATIC_ROOT, 'webpack-worker-stats.json')
18451849
}
18461850
}
18471851
WEBPACK_CONFIG_PATH = 'webpack.prod.config.js'

lms/envs/production.py

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
if STATIC_ROOT_BASE:
113113
STATIC_ROOT = path(STATIC_ROOT_BASE)
114114
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = STATIC_ROOT / "webpack-stats.json"
115+
WEBPACK_LOADER['WORKERS']['STATS_FILE'] = STATIC_ROOT / "webpack-worker-stats.json"
115116

116117

117118
# STATIC_URL_BASE specifies the base url to use for static files

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
"camelize": "1.0.0",
2222
"classnames": "2.2.5",
2323
"css-loader": "0.28.8",
24+
"datatables": "1.10.18",
25+
"datatables.net-fixedcolumns": "3.2.6",
2426
"edx-pattern-library": "0.18.1",
27+
"edx-proctoring": "file:../../../src/edx-proctoring",
2528
"edx-ui-toolkit": "1.5.2",
2629
"exports-loader": "0.6.4",
2730
"extract-text-webpack-plugin": "2.1.2",
@@ -60,7 +63,8 @@
6063
"webpack-bundle-tracker": "0.2.1",
6164
"webpack-merge": "4.1.1",
6265
"whatwg-fetch": "2.0.3",
63-
"which-country": "1.0.0"
66+
"which-country": "1.0.0",
67+
"worker-loader": "^2.0.0"
6468
},
6569
"devDependencies": {
6670
"@edx/stylelint-config-edx": "1.1.0",

webpack.dev.config.js

+28-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
var Merge = require('webpack-merge');
66
var path = require('path');
77
var webpack = require('webpack');
8+
// TODO: remove once common worker settings moved into common
9+
var BundleTracker = require('webpack-bundle-tracker');
810

911
var commonConfig = require('./webpack.common.config.js');
1012

11-
module.exports = Merge.smart(commonConfig, {
13+
module.exports = [Merge.smart(commonConfig, {
1214
output: {
1315
filename: '[name].js'
1416
},
@@ -57,4 +59,28 @@ module.exports = Merge.smart(commonConfig, {
5759
watchOptions: {
5860
ignored: [/node_modules/, /\.git/]
5961
}
60-
});
62+
}),
63+
{
64+
target: "webworker",
65+
context: __dirname,
66+
entry: {
67+
mockprock: './node_modules/edx-proctoring/edx_proctoring/static/proctoring/js/plugin/mockprock-provider.js',
68+
},
69+
output: {
70+
filename: '[name].js',
71+
path: path.resolve(__dirname, 'common/static/bundles'),
72+
},
73+
plugins: [
74+
new BundleTracker({
75+
path: process.env.STATIC_ROOT_LMS,
76+
filename: 'webpack-worker-stats.json'
77+
})
78+
],
79+
resolve: {
80+
extensions: ['.js'],
81+
modules: [
82+
'node_modules',
83+
'node_modules/edx-proctoring/node_modules'
84+
]
85+
}
86+
}];

0 commit comments

Comments
 (0)