Skip to content

Commit 5cc473e

Browse files
committed
[fix] to absolute path, typo
1 parent d5e4652 commit 5cc473e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index-webpack-plugin.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import { readFileSync, existsSync } from 'fs';
22
import { render } from 'ejs';
33
import { join } from 'path';
44
import { marked } from 'atool-doc-util';
5+
const root = join(__dirname, '..');
56

67
function addContentToAssets(content, filename, compilation) {
7-
const assets = { compilation };
8+
const { assets } = compilation;
89
assets[filename] = {
910
source: () => content,
1011
size: () => content.length,
@@ -24,7 +25,7 @@ export default function IndexWebpackPlugin(options) {
2425
fileDependencies: ['package.json', 'README.md', 'HISTORY.md', 'CHANGELOG.md'],
2526
contextDependencies: [],
2627
file: 'index.html',
27-
template: 'tpl/index.ejs',
28+
template: join(root, 'tpl/index.ejs'),
2829
params: {
2930
title: 'index.html',
3031
},

0 commit comments

Comments
 (0)