From e892deb7cbac57fbe2bb61286ddec324870126a3 Mon Sep 17 00:00:00 2001 From: Matteo Bertoldo Date: Tue, 25 Oct 2022 17:17:16 +0200 Subject: [PATCH] chore: added a support for custom glob patterns BREAKING CHANGE: removed the default final glob patterns that included *.mjml. --- README.md | 10 +++++----- src/webpack-mjml-store.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7b0dea6..14009f6 100644 --- a/README.md +++ b/README.md @@ -71,11 +71,11 @@ module.exports = { In addition to the options available in the MJML documentation, there are 3 additional parameters described in the table below: -| Parameter | Type | Default | Description | -| -------------------- | :------: | :-------------: | --------------------------------------------------- | -| `inputPath` | `string` | `undefined` | The path where `.mjml` files are located. | -| `options.extensions` | `string` | `.html` | The default output extension. | -| `options.outputPath` | `string` | `process.cwd()` | The path where compiled files should be written to. | +| Parameter | Type | Default | Description | +| -------------------- | :------: | :-------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `inputPath` | `string` | `undefined` | The path where `.mjml` files are located. The string supports [glob](https://github.com/isaacs/node-glob#glob-primer) syntax ex: `path/to/mjml/**/*.mjml` | +| `options.extensions` | `string` | `.html` | The default output extension. | +| `options.outputPath` | `string` | `process.cwd()` | The path where compiled files should be written to. | ## Contributing :busts_in_silhouette: diff --git a/src/webpack-mjml-store.js b/src/webpack-mjml-store.js index 2d4c751..34599c8 100644 --- a/src/webpack-mjml-store.js +++ b/src/webpack-mjml-store.js @@ -29,7 +29,7 @@ const WebpackMjmlStore = function (inputPath, options) { WebpackMjmlStore.prototype.apply = function (compiler) { const that = this; compiler.hooks.make.tapAsync(packageJSON.name, function (compilation, callback) { - glob(`${that.inputPath}/**/*.mjml`, async function (err, files) { + glob(`${that.inputPath}`, async function (err, files) { if (err) { throw err; }