From 7b15533541253dcf9125dc97fe9c06e97af95c6d Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Sat, 7 Sep 2019 09:44:12 -0400 Subject: [PATCH] Better plugin watch logic --- app/plugins/templates/webpack.config.js.tmpl | 8 ++++++-- plugins/cloudimport/plugin.py | 1 + webpack.config.js | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/plugins/templates/webpack.config.js.tmpl b/app/plugins/templates/webpack.config.js.tmpl index 72c26707..2443bafb 100644 --- a/app/plugins/templates/webpack.config.js.tmpl +++ b/app/plugins/templates/webpack.config.js.tmpl @@ -4,7 +4,6 @@ require("module").Module._initPaths(); let path = require("path"); let ExtractTextPlugin = require('extract-text-webpack-plugin'); -let LiveReloadPlugin = require('webpack-livereload-plugin'); module.exports = { mode: 'production', @@ -19,7 +18,6 @@ module.exports = { }, plugins: [ - new LiveReloadPlugin(), new ExtractTextPlugin('[name].css', { allChunks: true }) @@ -84,5 +82,11 @@ module.exports = { "leaflet": "leaflet", "ReactDOM": "ReactDOM", "React": "React" + }, + + watchOptions: { + ignored: /node_modules/, + aggregateTimeout: 300, + poll: 1000 } } \ No newline at end of file diff --git a/plugins/cloudimport/plugin.py b/plugins/cloudimport/plugin.py index e266484b..57a872f8 100644 --- a/plugins/cloudimport/plugin.py +++ b/plugins/cloudimport/plugin.py @@ -25,6 +25,7 @@ class Plugin(PluginBase): api_views = [api_view for platform in get_all_extended_platforms() for api_view in platform.get_api_views()] mount_points = [MountPoint(path, view) for (path, view) in api_views] # Add mount points for each extended platform that might require us to do so + return mount_points + [ MountPoint("projects/(?P[^/.]+)/tasks/(?P[^/.]+)/import", ImportFolderTaskView.as_view()), MountPoint("projects/(?P[^/.]+)/tasks/(?P[^/.]+)/checkforurl", CheckUrlTaskView.as_view()), diff --git a/webpack.config.js b/webpack.config.js index 921b4ef9..73cc27ca 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -90,5 +90,11 @@ module.exports = { "jquery": "jQuery", "SystemJS": "SystemJS", "React": "React" + }, + + watchOptions: { + ignored: /node_modules/, + aggregateTimeout: 300, + poll: 1000 } } \ No newline at end of file