2016-07-27 3 views
0

私はいくつかの反応するhtmlを生成しようとしていますが、奇妙なスペースがhtmlを破るように挿入されています。pg-generator nunjucks不必要なスペースが挿入され、htmlが破損しています

助けてください!!!!コマンドを実行しているベーステンプレート

を使用して

pgen exec pg-generator-templates/react-crud-template/ -d convectorFeathersServer -u postgres -p postgres -t src/react-crud-build

私のテンプレートファイル:

<!doctype html> 
<html lang="en"> 
    <head> 
<meta charset="utf-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1"> 
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css"> 
<title>React App</title> 
</head> 
<body> 
<div id="root"></div> 
<script src="bundle.js"></script> 
</body> 

結果

< !doctype html > 
    < 
    html lang = "en" > 
    < 
    head > 
    < 
    meta charset = "utf-8" > 
    < 
    meta name = "viewport" 
content = "width=device-width, initial-scale=1" > 
    < 
    link rel = "stylesheet" 
href = "https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css" > 
    < 
    title > React App < /title> < 
    /head> < 
    body > 
    < 
    div id = "root" > < /div> 
    < 
    script src = "bundle.js" > < /script> < 
    /body> < 
    /html> 
+0

オザム氏は喜んで答えてここに答えました! https://github.com/ozum/pg-generator/issues/30 – fedevela

+0

htmlとjsの拡張機能に結びついている美人がいるようです...私は.jsxで試しませんでした.....: - ? – fedevela

答えて

0

https://github.com/ozum/pg-generator/issues/30

ozumはコメントして2時間前 こんにちは、奇妙だ

。 pg-generatorによって使用されるjs美化が理由かもしれません。その関数内のlib/index.jsの121

if (path.extname(target) === '.js' || path.extname(target) === '.html') { 
     content   = beautify(content, this.beautyOptions); 
    } 
    // if (path.extname(target) === '.js' || path.extname(target) === '.html') { 
    //  content   = beautify(content, this.beautyOptions); 
    // } 

コンテンツのテキストがファイルに書き込まれるように生成される -

あなたがライン119は、コメントしてくださいでした。結果を報告してください、私はそれを修正するために何かを描くことができます。

関連する問題