Skip to content

Commit 8ad044d

Browse files
josephggoto-bus-stop
authored andcommitted
Added default export in server code. (#135)
This is necessary for nanohtml to work on the server via typescript. The types declarations declares a default export: ```typescript declare module "nanohtml" { export default function (strings: TemplateStringsArray, ...keys: any[]): HTMLElement; // ... } ``` So its necessary for the code to match. The code in browser.js already does this. Fixes #130
1 parent e3779cf commit 8ad044d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var BOOL_PROPS = require('./bool-props')
33
var boolPropRx = new RegExp('([^-a-z](' + BOOL_PROPS.join('|') + '))=["\']?$', 'i')
44

55
module.exports = nanothtmlServer
6+
module.exports.default = module.exports
67

78
function nanothtmlServer (src, filename, options, done) {
89
if (typeof src === 'string' && !/\n/.test(src) && filename && filename._flags) {

0 commit comments

Comments
 (0)