Skip to content

Commit

Permalink
webpack: Resolve asset watching not compiling
Browse files Browse the repository at this point in the history
- Conditionally set 'cache' based on environment, enabled in production and disabled otherwise
- Added exclusion of node_modules in watchOptions to improve watch performance.
  • Loading branch information
Samk13 committed Dec 23, 2023
1 parent f562914 commit 97184ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion invenio_assets/assets/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright (C) 2017-2018 CERN.
* Copyright (C) 2022-2023 Graz University of Technology.
* Copyright (C) 2023 TU Wien.
* Copyright (C) 2023 KTH Royal Institute of Technology.
*
* Invenio is free software; you can redistribute it and/or modify it
* under the terms of the MIT License; see LICENSE file for more details.
Expand Down Expand Up @@ -207,7 +208,7 @@ var webpackConfig = {
filename: "css/[name].[contenthash].css",
chunkFilename: "css/[name].[contenthash].css",
}),
// Removes the dist folder before each run.
// Removes the dist folder before each run.
new CleanWebpackPlugin({
dry: false,
verbose: false,
Expand Down Expand Up @@ -251,7 +252,9 @@ var webpackConfig = {
},
watchOptions: {
followSymlinks: true,
ignored: "**/node_modules",
},
cache: process.env.NODE_ENV === "production" ? true : false,
};

if (process.env.npm_config_report) {
Expand Down

0 comments on commit 97184ba

Please sign in to comment.