2017-09-04 1 views
1

Webpack이 아래 HTML이 포함 된 내 앱을 컴파일하면 theme 변수가 정의되지 않았다고 불평합니다. 여기 Thymeleaf 변수가 정의되지 않았기 때문에 HTML Webpack 플러그인이 컴파일되지 않습니다

<!DOCTYPE html> 
<html lang="en" xmlns:th="http://www.thymeleaf.org"> 
<head> 
    <meta charset="UTF-8"/> 
</head> 
<body th:class="${theme}"> 
    <div id="root"></div> 
</body> 
</html> 

그리고

은 내가 오류입니다 : 여기

Failed to compile. 

Error in Template execution failed: ReferenceError: theme is not defined 

- loader.js:4 eval 
/src/main/resources/templates/index.html?./~/html-webpack-plugin/lib/loader.js:4:10 

답변

0

같은 오류

여기 내 index.html 파일입니다. 나는 this issue를 발견했습니다 당신은 웹팩 사용이 같은 'HTML 로더'하기 위해 단지가 있습니다

new HtmlWebpackPlugin({ 
    template: '!!html-loader!index.html' 
}) 

PS : NPM과 전에 설치하는 것을 잊지 마십시오)

관련 문제