Skip to content

Commit 3a27b9c

Browse files
Mark the package side-effect free and export package.json
1 parent 059fe47 commit 3a27b9c

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
"types": "./dist/index.d.ts",
1717
"default": "./dist/index.js"
1818
}
19-
}
19+
},
20+
"./package.json": "./package.json"
2021
},
22+
"sideEffects": false,
2123
"homepage": "https://ipregistry.co",
2224
"license": "Apache-2.0",
2325
"keywords": [

test/packaging.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ describe('package exports', () => {
5050
expect(rootExport.require.types).to.match(/\.d\.ts$/)
5151
})
5252

53+
it('exposes package.json and declares the package side-effect free', () => {
54+
expect(packageJson.exports['./package.json']).to.equal('./package.json')
55+
expect(packageJson.sideEffects).to.be.false
56+
})
57+
5358
it('only references files that the build produces', () => {
5459
for (const path of collectPaths(packageJson.exports)) {
5560
const resolved = fileURLToPath(

0 commit comments

Comments
 (0)