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/*"
  }
}
```
This commit is contained in:
Eric Eastwood 2022-02-24 13:02:55 -06:00
parent db6d3797d7
commit 2153fa4852
1 changed files with 1 additions and 1 deletions

View File

@ -67,7 +67,7 @@ function installRoutes(app) {
// account `package.json`. `exports`, see // account `package.json`. `exports`, see
// https://github.com/mysticatea/eslint-plugin-node/issues/255 // https://github.com/mysticatea/eslint-plugin-node/issues/255
// eslint-disable-next-line node/no-missing-require // 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) { app.get('/hydrogen-styles.css', async function (req, res) {
res.set('Content-Type', 'text/css'); res.set('Content-Type', 'text/css');