diff --git a/.gitignore b/.gitignore index 2ca2591..0c22915 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ node_modules .DS_Store package-lock.json .bloggify/* +dist diff --git a/lib/index.d.ts b/index.d.ts similarity index 100% rename from lib/index.d.ts rename to index.d.ts diff --git a/package.json b/package.json index d66dee2..15a998b 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,21 @@ "name": "parse-url", "version": "8.0.0", "description": "An advanced url parser supporting git urls too.", - "main": "lib/index.js", - "type": "module", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./index.d.ts", + "exports": { + "types": "./index.d.ts", + "require": "./dist/index.js", + "import": "./dist/index.mjs" + }, "directories": { "example": "example", "test": "test" }, "scripts": { - "test": "node test" + "test": "node test/index.mjs", + "build": "pkgroll" }, "repository": { "type": "git", @@ -29,7 +36,9 @@ }, "homepage": "https://github.com/IonicaBizau/parse-url", "devDependencies": { - "tester": "^1.3.1" + "pkgroll": "^1.4.0", + "tester": "^1.3.1", + "normalize-url": "^7.0.3" }, "dependencies": { "normalize-url": "^7.0.3", diff --git a/lib/index.js b/src/index.js similarity index 99% rename from lib/index.js rename to src/index.js index fe5a052..3981b89 100644 --- a/lib/index.js +++ b/src/index.js @@ -1,5 +1,3 @@ -"use strict" - // Dependencies import parsePath from "parse-path"; import normalizeUrl from "normalize-url"; diff --git a/test/index.js b/test/index.mjs similarity index 99% rename from test/index.js rename to test/index.mjs index 288c36c..7b484ba 100644 --- a/test/index.js +++ b/test/index.mjs @@ -1,5 +1,5 @@ // Dependencies -import parseUrl from "../lib/index.js"; +import parseUrl from "../dist/index.mjs"; import tester from "tester"; import normalizeUrl from "normalize-url";