Skip to content

Commit 01880cf

Browse files
committed
Add method on "Encore"
1 parent 49a4258 commit 01880cf

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

index.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,32 @@ class Encore {
11001100
return this;
11011101
}
11021102

1103+
/**
1104+
* Configure Webpack loaders rules (`module.rules`).
1105+
* This is a low-level function, be careful when using it.
1106+
*
1107+
* https://webpack.js.org/concepts/loaders/#configuration
1108+
*
1109+
* For example, if you are using Vue and ESLint loader,
1110+
* this is how you can configure ESLint to lint Vue files:
1111+
*
1112+
* Encore
1113+
* .enableEslintLoader()
1114+
* .enableVueLoader()
1115+
* .configureLoaderRule('eslint', (loader) => {
1116+
* loader.test = /\.(jsx?|vue)/;
1117+
* });
1118+
*
1119+
* @param {string} name
1120+
* @param {function} callback
1121+
* @return {Encore}
1122+
*/
1123+
configureLoaderRule(name, callback) {
1124+
webpackConfig.configureLoaderRule(name, callback);
1125+
1126+
return this;
1127+
}
1128+
11031129
/**
11041130
* If enabled, the output directory is emptied between each build (to remove old files).
11051131
*

0 commit comments

Comments
 (0)