Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

解析模板文件错误 #9

Closed
rainke opened this issue Jun 7, 2017 · 3 comments
Closed

解析模板文件错误 #9

rainke opened this issue Jun 7, 2017 · 3 comments
Labels

Comments

@rainke
Copy link

rainke commented Jun 7, 2017

{
  "art-template": "^4.10.1",
  "art-template-loader": "^1.4.3",
  "html-webpack-plugin": "^2.28.0",
  "webpack": "^2.6.1"
}

new htmlWebpackPlugin({
    title: 'webpack-multipages',
    template: './src/assets/index.art'
  })
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title><%= htmlWebpackPlugin.options.title%></title>
</head>
<body>
  <%- include("./header", {user: "hehe2"})%>
</body>
</html>

在 include 前面如果有 -,则 include 进来的模板包含完整的 doctype>html>head+body>header,

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>webpack-multipages</title>
</head>
<body>
  <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>webpack-multipages</title>
</head>
<body>
  <nav>
  hehe2
</nav>
<script type="text/javascript" src="/index.js"></script></body>
</html>

而没有-则正常

@aui
Copy link
Owner

aui commented Jun 8, 2017

能否提供一个 zip 下载?

@rainke
Copy link
Author

rainke commented Jun 8, 2017

@aui github

@aui
Copy link
Owner

aui commented Jun 8, 2017

art-template@4.10.2 已经解决此 BUG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants