Skip to content

Commit 53baf2c

Browse files
Merge pull request #106 from preactjs/pretty_render
Fix pretty option doing nothing
2 parents 470f098 + f35acb8 commit 53baf2c

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

env.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"jsnext:main": "dist/index.module.js",
1010
"scripts": {
1111
"build": "npm run -s transpile && npm run -s transpile:jsx && npm run -s copy-typescript-definition",
12-
"transpile": "echo 'export const ENABLE_PRETTY = false;'>env.js && microbundle src/index.js -f es,umd --target web --external preact",
13-
"transpile:jsx": "echo 'export const ENABLE_PRETTY = true;'>env.js && microbundle src/jsx.js -o dist/jsx.js --target web --external none && microbundle dist/jsx.js -o dist/jsx.js -f cjs",
12+
"transpile": "microbundle src/index.js -f es,umd --target web --external preact",
13+
"transpile:jsx": "microbundle src/jsx.js -o dist/jsx.js --target web --external none && microbundle dist/jsx.js -o dist/jsx.js -f cjs",
1414
"copy-typescript-definition": "copyfiles -f src/index.d.ts dist",
1515
"test": "eslint src test && tsc && mocha --compilers js:babel-register test/**/*.js",
1616
"prepublish": "npm run build",

src/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { encodeEntities, indent, isLargeString, styleObjToCss, assign, getChildren } from './util';
2-
import { ENABLE_PRETTY } from '../env';
32
import { options, Fragment, createElement } from 'preact';
43

54
const SHALLOW = { shallow: true };
@@ -50,7 +49,7 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
5049
context = context || {};
5150
opts = opts || {};
5251

53-
let pretty = ENABLE_PRETTY && opts.pretty,
52+
let pretty = opts.pretty,
5453
indentChar = pretty && typeof pretty==='string' ? pretty : '\t';
5554

5655
// #text nodes

0 commit comments

Comments
 (0)