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 529aa89..ccd42fe 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,21 @@ "name": "parse-url", "version": "7.0.3", "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,11 +36,12 @@ }, "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": { - "parse-path": "^5.0.0", - "normalize-url": "^7.0.3" + "parse-path": "^5.0.0" }, "files": [ "bin/", diff --git a/lib/index.js b/src/index.js similarity index 99% rename from lib/index.js rename to src/index.js index 988665c..2746214 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 98% rename from test/index.js rename to test/index.mjs index 98b0a38..37874c9 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";