Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow HMR in Rancher Components and Harvester #13051

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions shell/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ const printLogs = (dev, dashboardVersion, resourceBase, routerBasePath, pl, ranc
* - as list: [/.shell/, /dist-pkg/, /scripts\/standalone/, /\/pkg.test-pkg/, /\/pkg.harvester/]
* - as chained regex rule: /.shell|dist-pkg|scripts\/standalone|\/pkg.test-pkg|\/pkg.harvester/
*/
const getWatcherIgnored = (excludes) => {
const getWatcherIgnored = (excludes = []) => {
const paths = [
/node_modules/,
/dist-pkg/,
Expand All @@ -474,12 +474,11 @@ const getWatcherIgnored = (excludes) => {
* This takes the directory of the application as the first argument so that we can derive folder locations
* from it, rather than from the location of this file
*/
module.exports = function(dir, _appConfig) {
module.exports = function(dir, appConfig = {}) {
require('events').EventEmitter.defaultMaxListeners = 20;
require('dotenv').config();

const { SHELL_ABS, COMPONENTS_DIR } = getShellPaths(dir);
const appConfig = _appConfig || {};
const excludes = appConfig.excludes || [];

const includePkg = (name) => {
Expand Down Expand Up @@ -557,7 +556,7 @@ module.exports = function(dir, _appConfig) {
config.resolve.extensions.push(...['.tsx', '.ts', '.js', '.vue', '.scss']);
config.watchOptions = {
...(config.watchOptions || {}),
ignored: getWatcherIgnored(excludes)
ignored: getWatcherIgnored()
};

if (dev) {
Expand Down
Loading