@bonsae/nrg 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -785,7 +785,13 @@ function serveNrgResources(RED) {
785
785
  httpAdmin.use(function(req, res, next) {
786
786
  const prefix = "/nrg/assets/";
787
787
  if (!req.path.startsWith(prefix)) return next();
788
- const reqPath = req.path.slice(prefix.length).replace(/\.\./g, "");
788
+ let reqPath = req.path.slice(prefix.length).replace(/\.\./g, "");
789
+ if (reqPath === "vue.esm-browser.prod.js" && process.env.NODE_ENV !== "production") {
790
+ const devPath = import_path.default.resolve(clientDir, "vue.esm-browser.js");
791
+ if (import_fs.default.existsSync(devPath)) {
792
+ reqPath = "vue.esm-browser.js";
793
+ }
794
+ }
789
795
  const filePath = import_path.default.resolve(clientDir, reqPath);
790
796
  if (!filePath.startsWith(clientDir)) return next();
791
797
  if (!import_fs.default.existsSync(filePath) || !import_fs.default.statSync(filePath).isFile())