Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
3b43fb38
Commit
3b43fb38
authored
Apr 07, 2017
by
Brian Jacobel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Paver runs Webpack (incl watcher) in dev and test
parent
ef4b5cb8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
5 deletions
+40
-5
common/static/common/js/karma.common.conf.js
+12
-2
lms/static/lms/js/build.js
+1
-2
openedx/features/course_experience/static/course_experience/js/CourseOutline.js
+1
-1
pavelib/assets.py
+17
-0
pavelib/paver_tests/test_servers.py
+5
-0
webpack.config.js
+4
-0
No files found.
common/static/common/js/karma.common.conf.js
View file @
3b43fb38
...
...
@@ -189,7 +189,11 @@ function normalizePathsForCoverage(files, normalizeFunc, preprocessors) {
files
.
forEach
(
function
(
file
)
{
if
(
!
file
.
ignoreCoverage
)
{
normalizedFile
=
normalizeFn
(
appRoot
,
file
.
pattern
);
filesForCoverage
[
normalizedFile
]
=
[
'coverage'
].
concat
(
preprocessors
[
normalizedFile
]
||
[]);
if
(
preprocessors
&&
preprocessors
.
hasOwnProperty
(
normalizedFile
))
{
filesForCoverage
[
normalizedFile
]
=
[
'coverage'
].
concat
(
preprocessors
[
normalizedFile
]);
}
else
{
filesForCoverage
[
normalizedFile
]
=
[
'coverage'
];
}
}
});
...
...
@@ -346,7 +350,13 @@ function getBaseConfig(config, useRequireJs) {
captureConsole
:
false
},
webpack
:
webpackConfig
webpack
:
webpackConfig
,
webpackMiddleware
:
{
watchOptions
:
{
poll
:
true
}
}
};
}
...
...
lms/static/lms/js/build.js
View file @
3b43fb38
...
...
@@ -18,8 +18,7 @@
* done.
*/
modules
:
getModulesList
([
'course_bookmarks/js/course_bookmarks_factory'
,
'course_experience/js/course_outline_factory'
,
'course_bookmarks/js/course_bookmarks_factory'
,,
'discussion/js/discussion_board_factory'
,
'discussion/js/discussion_profile_page_factory'
,
'js/api_admin/catalog_preview_factory'
,
...
...
openedx/features/course_experience/static/course_experience/js/CourseOutline.js
View file @
3b43fb38
...
...
@@ -22,7 +22,7 @@ export class CourseOutline { // eslint-disable-line import/prefer-default-expor
}
}));
document
.
querySelectorAll
(
'a:not([href^="#"])'
)
[...
document
.
querySelectorAll
(
'a:not([href^="#"])'
)]
.
forEach
(
link
=>
link
.
addEventListener
(
'click'
,
(
event
)
=>
{
Logger
.
log
(
'edx.ui.lms.link_clicked'
,
...
...
pavelib/assets.py
View file @
3b43fb38
...
...
@@ -19,6 +19,7 @@ from watchdog.events import PatternMatchingEventHandler
from
.utils.envs
import
Env
from
.utils.cmd
import
cmd
,
django_cmd
from
.utils.timer
import
timed
from
.utils.process
import
run_background_process
from
openedx.core.djangoapps.theming.paver_helpers
import
get_theme_paths
...
...
@@ -703,6 +704,16 @@ def execute_compile_sass(args):
)
@task
@no_help
def
execute_webpack
():
sh
(
cmd
(
"$(npm bin)/webpack"
))
def
execute_webpack_watch
():
run_background_process
(
"$(npm bin)/webpack --watch --watch-poll=200"
)
def
get_parsed_option
(
command_opts
,
opt_key
,
default
=
None
):
"""
Extract user command option and parse it.
...
...
@@ -769,6 +780,11 @@ def watch_assets(options):
print
(
"Starting asset watcher..."
)
observer
.
start
()
# We only want Webpack to re-run on changes to its own entry points, not all JS files, so we use its own watcher
# instead of subclassing from Watchdog like the other watchers do
execute_webpack_watch
()
if
not
getattr
(
options
,
'background'
,
False
):
# when running as a separate process, the main thread needs to loop
# in order to allow for shutdown by contrl-c
...
...
@@ -829,6 +845,7 @@ def update_assets(args):
process_xmodule_assets
()
process_npm_assets
()
compile_coffeescript
()
execute_webpack
()
# Compile sass for themes and system
execute_compile_sass
(
args
)
...
...
pavelib/paver_tests/test_servers.py
View file @
3b43fb38
...
...
@@ -40,6 +40,9 @@ EXPECTED_RUN_SERVER_COMMAND = (
EXPECTED_INDEX_COURSE_COMMAND
=
(
u"python manage.py {system} --settings={settings} reindex_course --setup"
)
EXPECTED_WEBPACK_COMMAND
=
(
u"$(npm bin)/webpack"
)
@ddt.ddt
...
...
@@ -233,6 +236,7 @@ class TestPaverServerTasks(PaverTestCase):
expected_messages
.
append
(
u"xmodule_assets common/static/xmodule"
)
expected_messages
.
append
(
u"install npm_assets"
)
expected_messages
.
append
(
EXPECTED_COFFEE_COMMAND
.
format
(
platform_root
=
self
.
platform_root
))
expected_messages
.
append
(
EXPECTED_WEBPACK_COMMAND
)
expected_messages
.
extend
(
self
.
expected_sass_commands
(
system
=
system
,
asset_settings
=
expected_asset_settings
))
if
expected_collect_static
:
expected_messages
.
append
(
EXPECTED_COLLECT_STATIC_COMMAND
.
format
(
...
...
@@ -270,6 +274,7 @@ class TestPaverServerTasks(PaverTestCase):
expected_messages
.
append
(
u"xmodule_assets common/static/xmodule"
)
expected_messages
.
append
(
u"install npm_assets"
)
expected_messages
.
append
(
EXPECTED_COFFEE_COMMAND
.
format
(
platform_root
=
self
.
platform_root
))
expected_messages
.
append
(
EXPECTED_WEBPACK_COMMAND
)
expected_messages
.
extend
(
self
.
expected_sass_commands
(
asset_settings
=
expected_asset_settings
))
if
expected_collect_static
:
expected_messages
.
append
(
EXPECTED_COLLECT_STATIC_COMMAND
.
format
(
...
...
webpack.config.js
View file @
3b43fb38
...
...
@@ -45,6 +45,10 @@ var wpconfig = {
resolve
:
{
extensions
:
[
'.js'
,
'.json'
]
},
watchOptions
:
{
poll
:
true
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment