Skip to content

Commit d7de630

Browse files
authored
Merge pull request #12 from ncphillips/11-browser-support
output browser compatible bundle
2 parents 391a2f9 + 0c3287e commit d7de630

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/type-scripts/scripts/build.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,17 @@ const inputOptions = {
3232
],
3333
}
3434

35+
function snakeToCamel(s) {
36+
s[0].toUpperCase()
37+
return s.replace(/(\-\w)/g, function(m) {
38+
return m[1].toUpperCase()
39+
})
40+
}
41+
let packageNameParts = package.name.split(".")
3542
const outputOptions = {
3643
file: package.main,
37-
format: "cjs",
44+
name: snakeToCamel(packageNameParts[packageNameParts.length - 1]),
45+
format: "umd",
3846
}
3947

4048
async function build() {

0 commit comments

Comments
 (0)