diff --git a/package.json b/package.json index 83ad74a..f7f1646 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "lint": "eslint {src,test}", "test:karma": "karma start --single-run", "prepublish": "npm-run-all build test", + "prepare": "npm run -s build", "release": "npm run -s build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish" }, "keywords": [ diff --git a/src/index.js b/src/index.js index 92585bf..843f473 100644 --- a/src/index.js +++ b/src/index.js @@ -37,6 +37,10 @@ export default class Markup extends Component { trim }; + if (typeof document === 'undefined') { + return h('div', Object.assign({ dangerouslySetInnerHTML: { __html: markup } }, props), null); + } + try { vdom = markupToVdom(markup, type, h, this.map, options); } catch (error) {