Skip to content

Commit

Permalink
Add method on "Encore"
Browse files Browse the repository at this point in the history
  • Loading branch information
Kocal committed Mar 1, 2019
1 parent 49a4258 commit 01880cf
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1100,6 +1100,32 @@ class Encore {
return this;
}

/**
* Configure Webpack loaders rules (`module.rules`).
* This is a low-level function, be careful when using it.
*
* https://webpack.js.org/concepts/loaders/#configuration
*
* For example, if you are using Vue and ESLint loader,
* this is how you can configure ESLint to lint Vue files:
*
* Encore
* .enableEslintLoader()
* .enableVueLoader()
* .configureLoaderRule('eslint', (loader) => {
* loader.test = /\.(jsx?|vue)/;
* });
*
* @param {string} name
* @param {function} callback
* @return {Encore}
*/
configureLoaderRule(name, callback) {
webpackConfig.configureLoaderRule(name, callback);

return this;
}

/**
* If enabled, the output directory is emptied between each build (to remove old files).
*
Expand Down

0 comments on commit 01880cf

Please sign in to comment.