fix: generate valid javascript modules in build (#1080)

Before this change snabbdom could only be consumed by bundlers like webpack.
Now we add the `.js` extension to the build outputs so browsers can import the modules directly as well.
ISSUES FIXED: #963
pull/1081/head
Michael Reinstein 1 year ago committed by GitHub
parent f5fcde33ec
commit 7ec0e9018a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
package-lock.json generated

@ -32,6 +32,7 @@
"prettier": "^3.0.3",
"release-it": "^16.2.1",
"serve": "^14.2.1",
"ts-add-js-extension": "^1.6.0",
"typescript": "5.2.2"
},
"engines": {
@ -12722,6 +12723,18 @@
"node": "*"
}
},
"node_modules/ts-add-js-extension": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/ts-add-js-extension/-/ts-add-js-extension-1.6.0.tgz",
"integrity": "sha512-vJSCfL0YEn0tPxJKSOgMEjxPoKnqLaW+stSLEtpY974/GkgEVukc0O7Q4ryAGbvEzP1WYVW/w563TO3uvFFbqw==",
"dev": true,
"dependencies": {
"typescript": "^5.2.2"
},
"bin": {
"ts-add-js-extension": "build/cjs/bin.js"
}
},
"node_modules/ts-api-utils": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz",

@ -31,7 +31,7 @@
"types": "build/index.d.ts",
"sideEffects": false,
"scripts": {
"build": "tsc",
"build": "tsc && ts-add-js-extension --dir=build",
"examples": "serve .",
"format": "prettier --write .",
"prepare": "husky install",
@ -65,6 +65,7 @@
"prettier": "^3.0.3",
"release-it": "^16.2.1",
"serve": "^14.2.1",
"ts-add-js-extension": "^1.6.0",
"typescript": "5.2.2"
},
"prettier": {

Loading…
Cancel
Save