Skip to content

Commit

Permalink
Use native import.meta.resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
Siilwyn committed Mar 25, 2024
1 parent 5a5c7ba commit 6347ed0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"test": "uvu src .+\\.test\\.mjs",
"test:ci": "npm test && npm run lint -- --max-warnings 0",
"lint": "eslint src/core/*.mjs",
"scrape": "node --experimental-import-meta-resolve src/property-scraper.mjs",
"scrape": "node src/property-scraper.mjs",
"prepack": "npm run build"
},
"devDependencies": {
Expand Down
4 changes: 1 addition & 3 deletions src/property-scraper.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import fs from 'node:fs/promises';

const { css } = await import.meta.resolve('@mdn/browser-compat-data')
.then((moduleResolution) => new URL(moduleResolution).pathname)
.then(fs.readFile)
const { css } = await fs.readFile(new URL(import.meta.resolve('@mdn/browser-compat-data')))
.then(JSON.parse);

const isStandardProperty = (name) => (property) => Boolean(
Expand Down

0 comments on commit 6347ed0

Please sign in to comment.