Limpus
@Limpus

Почему не работает Plugin posthtml-include для Grunt?

Почему не работает Plugin posthtml-include для Grunt?

Файл: package.json
{
	"name": "test",
	"version": "1.0.0",
	"devDependencies": {
		"grunt": "^1.0.3",
		"grunt-browser-sync": "^2.2.0",
		"grunt-contrib-imagemin": "^3.1.0",
		"grunt-contrib-less": "^2.0.0",
		"grunt-contrib-watch": "^1.1.0",
		"grunt-csso": "^2.2.4",
		"grunt-cwebp": "^2.1.1",
		"grunt-newer": "^1.3.0",
		"grunt-postcss": "^0.9.0",
		"grunt-posthtml": "^0.5.0",
		"grunt-rigger": "^0.6.0",
		"grunt-svgstore": "^2.0.0",
		"load-grunt-tasks": "^4.0.0",
		"posthtml-include": "^1.2.0"
	},
	"dependencies": {
		"autoprefixer": "^9.4.9",
		"cssnano": "^4.1.10",
		"pixrem": "^5.0.0"
	}
}


Файл: Gruntfile.js
posthtml: {
				options: {
					use: [
						require('posthtml-include')({ root: './', encoding: 'utf-8' })
					]
				},
				build: {
					files: [
						{
							src: ["src/html/index.html"],
							expand: true
						}
					]
				}
			}


Файл: index.html
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
		<title>Test</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link href="css/library/normalize.css"rel="stylesheet">
		<link href="css/all.min.css" rel="stylesheet">
	</head>
	<body>

	<include src="header.html"></include>

	</body>
</html>
  • Вопрос задан
  • 202 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы