From 2153fa48527399b54b91f7368f4b2a1b79907957 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Thu, 24 Feb 2022 13:02:55 -0600 Subject: [PATCH] Use file that will resolve in new `./assets/*` export Because we had to update the `assets` `export` to avoid the following deprecation warning: ``` (node:133896) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./assets/" in the "exports" field module resolution of the package at C:\Users\MLM\Documents\GitHub\element\matrix-public-archive\node_modules\hydrogen-view-sdk\package.json. Update this package.json to use a subpath pattern like "./assets/*". (Use `node --trace-deprecation ...` to show where the warning was created) ``` `hydrogen-view-sdk` `package.json` before: ```json { "exports": { ".": { "import": "./lib-build/hydrogen.es.js", "require": "./lib-build/hydrogen.cjs.js" }, "./paths/vite": "./paths/vite.js", "./style.css": "./style.css", "./assets/": "./asset-build/assets/" } } ``` `hydrogen-view-sdk` `package.json` after: ```json { "exports": { ".": { "import": "./lib-build/hydrogen.es.js", "require": "./lib-build/hydrogen.cjs.js" }, "./paths/vite": "./paths/vite.js", "./style.css": "./style.css", "./assets/*": "./asset-build/assets/*" } } ``` --- server/routes/install-routes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/routes/install-routes.js b/server/routes/install-routes.js index ef7cbd1..9c269b1 100644 --- a/server/routes/install-routes.js +++ b/server/routes/install-routes.js @@ -67,7 +67,7 @@ function installRoutes(app) { // account `package.json`. `exports`, see // https://github.com/mysticatea/eslint-plugin-node/issues/255 // eslint-disable-next-line node/no-missing-require - app.use(express.static(path.dirname(require.resolve('hydrogen-view-sdk/assets/')))); + app.use(express.static(path.dirname(require.resolve('hydrogen-view-sdk/assets/index.js')))); app.get('/hydrogen-styles.css', async function (req, res) { res.set('Content-Type', 'text/css');