Skip to content

Commit

Permalink
feat: watch config file
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogobbosouza authored Jun 27, 2019
1 parent 5040aea commit 78fa12a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/module.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { resolve } = require('path')
const StyleLintPlugin = require('stylelint-webpack-plugin')
const logger = require('./logger')
const { moduleExists } = require('./utils')
Expand All @@ -16,6 +17,19 @@ module.exports = function (moduleOptions) {
...moduleOptions
}

const filesToWatch = [
'.stylelintrc',
'.stylelintrc.json',
'.stylelintrc.yaml',
'.stylelintrc.yml',
'.stylelintrc.js',
'stylelint.config.js'
]

this.options.watch.push(
...filesToWatch.map(file => resolve(this.options.rootDir, file))
)

this.extendBuild((config, { isDev }) => {
if (isDev) {
config.plugins.push(new StyleLintPlugin(options))
Expand Down

0 comments on commit 78fa12a

Please sign in to comment.