Skip to content

Commit

Permalink
WIP: currently dev-only approach to proctoring webworker JS API
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Hughes authored and Dave St.Germain committed Dec 21, 2018
1 parent 5e62714 commit edd15f1
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 3 deletions.
4 changes: 4 additions & 0 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,10 @@
'DEFAULT': {
'BUNDLE_DIR_NAME': 'bundles/',
'STATS_FILE': os.path.join(STATIC_ROOT, 'webpack-stats.json')
},
'WORKERS': {
'BUNDLE_DIR_NAME': 'bundles/',
'STATS_FILE': os.path.join(STATIC_ROOT, 'webpack-worker-stats.json')
}
}
WEBPACK_CONFIG_PATH = 'webpack.prod.config.js'
Expand Down
1 change: 1 addition & 0 deletions cms/envs/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
if STATIC_ROOT_BASE:
STATIC_ROOT = path(STATIC_ROOT_BASE) / 'studio'
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = STATIC_ROOT / "webpack-stats.json"
WEBPACK_LOADER['WORKERS']['STATS_FILE'] = STATIC_ROOT / "webpack-worker-stats.json"

EMAIL_BACKEND = ENV_TOKENS.get('EMAIL_BACKEND', EMAIL_BACKEND)
EMAIL_FILE_PATH = ENV_TOKENS.get('EMAIL_FILE_PATH', None)
Expand Down
4 changes: 4 additions & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,10 @@ def _make_locale_paths(settings):
'DEFAULT': {
'BUNDLE_DIR_NAME': 'bundles/',
'STATS_FILE': os.path.join(STATIC_ROOT, 'webpack-stats.json')
},
'WORKERS': {
'BUNDLE_DIR_NAME': 'bundles/',
'STATS_FILE': os.path.join(STATIC_ROOT, 'webpack-worker-stats.json')
}
}
WEBPACK_CONFIG_PATH = 'webpack.prod.config.js'
Expand Down
1 change: 1 addition & 0 deletions lms/envs/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
if STATIC_ROOT_BASE:
STATIC_ROOT = path(STATIC_ROOT_BASE)
WEBPACK_LOADER['DEFAULT']['STATS_FILE'] = STATIC_ROOT / "webpack-stats.json"
WEBPACK_LOADER['WORKERS']['STATS_FILE'] = STATIC_ROOT / "webpack-worker-stats.json"


# STATIC_URL_BASE specifies the base url to use for static files
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
"camelize": "1.0.0",
"classnames": "2.2.5",
"css-loader": "0.28.8",
"datatables": "1.10.18",
"datatables.net-fixedcolumns": "3.2.6",
"edx-pattern-library": "0.18.1",
"edx-proctoring": "file:../../../src/edx-proctoring",
"edx-ui-toolkit": "1.5.2",
"exports-loader": "0.6.4",
"extract-text-webpack-plugin": "2.1.2",
Expand Down Expand Up @@ -60,7 +63,8 @@
"webpack-bundle-tracker": "0.2.1",
"webpack-merge": "4.1.1",
"whatwg-fetch": "2.0.3",
"which-country": "1.0.0"
"which-country": "1.0.0",
"worker-loader": "^2.0.0"
},
"devDependencies": {
"@edx/stylelint-config-edx": "1.1.0",
Expand Down
30 changes: 28 additions & 2 deletions webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
var Merge = require('webpack-merge');
var path = require('path');
var webpack = require('webpack');
// TODO: remove once common worker settings moved into common
var BundleTracker = require('webpack-bundle-tracker');

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

module.exports = Merge.smart(commonConfig, {
module.exports = [Merge.smart(commonConfig, {
output: {
filename: '[name].js'
},
Expand Down Expand Up @@ -57,4 +59,28 @@ module.exports = Merge.smart(commonConfig, {
watchOptions: {
ignored: [/node_modules/, /\.git/]
}
});
}),
{
target: "webworker",
context: __dirname,
entry: {
mockprock: './node_modules/edx-proctoring/edx_proctoring/static/proctoring/js/plugin/mockprock-provider.js',
},
output: {
filename: '[name].js',
path: path.resolve(__dirname, 'common/static/bundles'),
},
plugins: [
new BundleTracker({
path: process.env.STATIC_ROOT_LMS,
filename: 'webpack-worker-stats.json'
})
],
resolve: {
extensions: ['.js'],
modules: [
'node_modules',
'node_modules/edx-proctoring/node_modules'
]
}
}];

0 comments on commit edd15f1

Please sign in to comment.