WIP: currently dev-only approach to proctoring webworker JS API

This commit is contained in:
Matt Hughes
2018-11-15 13:48:33 -05:00
committed by Dave St.Germain
parent 5e627145ed
commit edd15f1bdb
6 changed files with 43 additions and 3 deletions

View File

@@ -881,6 +881,10 @@ WEBPACK_LOADER = {
'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'

View File

@@ -128,6 +128,7 @@ STATIC_ROOT_BASE = ENV_TOKENS.get('STATIC_ROOT_BASE', None)
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)

View File

@@ -1842,6 +1842,10 @@ WEBPACK_LOADER = {
'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'

View File

@@ -112,6 +112,7 @@ STATIC_ROOT_BASE = ENV_TOKENS.get('STATIC_ROOT_BASE', None)
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

View File

@@ -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",
@@ -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",

View File

@@ -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'
},
@@ -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'
]
}
}];