Skip to content

Commit

Permalink
fix: use correct file name in watch
Browse files Browse the repository at this point in the history
  • Loading branch information
kshutkin committed Dec 16, 2021
1 parent 19e3513 commit 39caf95
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugin-html/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default function(options: HtmlPluginOptions = {}) {
}

async function buildStart(this: PluginContext) {
this.addWatchFile('src/index.html');
this.addWatchFile(template as string);
}

function renderStart() {
Expand Down
1 change: 1 addition & 0 deletions plugin-html/tests/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ describe('@rollup-extras/plugin-html', () => {
}
}]);

expect(rollupContextMock.addWatchFile).toBeCalledWith('index.html');
expect(rollupContextMock.emitFile).toBeCalledWith(expect.objectContaining({
fileName: 'index.html',
source: '<!DOCTYPE html><html><head><link rel=\"stylesheet\" href=\"main.css\" type=\"text/css\"></head><body>File Template<script src=\"index.js\" type=\"module\"></script></body></html>',
Expand Down

0 comments on commit 39caf95

Please sign in to comment.