Skip to content

Commit

Permalink
Merge pull request #96 from xenobytezero/feature/watch-dependencies
Browse files Browse the repository at this point in the history
Add all imported SASS files to the rollup's "watch" list
  • Loading branch information
elycruz committed Jul 20, 2022
2 parents 4d2037a + 67775ee commit 995ab29
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/index.ts
Expand Up @@ -174,10 +174,16 @@ export = function plugin(options = {} as RollupPluginSassOptions): RollupPlugin
.then(res => processRenderResponse(pluginOptions, filePath, pluginState, res.css.toString().trim())
.then(result => [res, result])
)
.then(([res, codeResult]) => ({
code: codeResult,
map: {mappings: res.map ? res.map.toString() : ''},
})); // @note do not `catch` here - let error propagate to rollup level.
.then(([res, codeResult]) => {

res.stats.includedFiles.forEach(i => {this.addWatchFile(i)})

return {
code: codeResult,
map: {mappings: res.map ? res.map.toString() : ''}
}

}); // @note do not `catch` here - let error propagate to rollup level.
},

generateBundle(generateOptions: { file?: string },
Expand Down

0 comments on commit 995ab29

Please sign in to comment.