From fd3e397f121f868b01d52e34fe45234e019ae40d Mon Sep 17 00:00:00 2001 From: bcheidemann Date: Sat, 13 Nov 2021 20:15:14 +0000 Subject: [PATCH 1/4] fix: make wepback plugin available from filer/webpack --- webpack/index.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 webpack/index.js diff --git a/webpack/index.js b/webpack/index.js new file mode 100644 index 00000000..7b353ccb --- /dev/null +++ b/webpack/index.js @@ -0,0 +1,3 @@ +module.exports = { + FilerWebpackPlugin: require('../src/webpack-plugin'), +}; From 854b5d7e1d9bfdf2bbe659c033cb8fd0245476a4 Mon Sep 17 00:00:00 2001 From: bcheidemann Date: Sat, 13 Nov 2021 20:16:39 +0000 Subject: [PATCH 2/4] deprecate accessing FilerWebpackPlugin through index.js --- src/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/index.js b/src/index.js index 8a77c737..0a25e255 100644 --- a/src/index.js +++ b/src/index.js @@ -9,6 +9,15 @@ module.exports = Filer = { path: require('./path.js'), Errors: require('./errors.js'), Shell: require('./shell/shell.js'), + /** + * @deprecated Importing filer from your webpack config is not recommended. + * + * The filer `FilerWebpackPlugin` class is exposed directly. + * + * ``` + * const { FilerWebpackPlugin } = require('filer/webpack'); + * ``` + */ FilerWebpackPlugin: require('./webpack-plugin'), }; From 62536b40d1fee0e6c3e6b064d29513e2ebf709bb Mon Sep 17 00:00:00 2001 From: bcheidemann Date: Sat, 13 Nov 2021 20:17:08 +0000 Subject: [PATCH 3/4] docs: update documentation to reflect changes to FilerWebpackPlugin --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 67a76a67..cd66390c 100644 --- a/README.md +++ b/README.md @@ -63,17 +63,28 @@ your webpack config: ```javascript // webpack.config.js -var filer = require('filer'); +var { FilerWebpackPlugin } = require('filer/webpack'); module.exports = { plugins: [ - new filer.FilerWebpackPlugin(), + new FilerWebpackPlugin(), ], } ``` +--- +**NOTE** + +Previously it was recommended to access the `FilerWebpackPlugin` class by importing the main filer module. This was depracated due the [this issue](https://github.com/filerjs/filer/issues/790). For anyone using ***filer version 1.3.1 or earlier***, please import the plugin class like this: + +```javascript +var FilerWebpackPlugin = require('filer/src/webpack-plugin'); +``` + +--- + You can then import the node.js [fs](http://nodejs.org/api/fs.html) and [path](http://nodejs.org/api/path.html) -modules as normal and FilerWebpackPlugin will ensure that webpack will resolve references to these modules to +modules as normal and `FilerWebpackPlugin` will ensure that webpack will resolve references to these modules to the appropriate filer shims. You will then be able to use these modules as normal (with the exception of the synchronous fs methods e.g. `mkdirSync()`). From bd268ee9a88e2544eb2cfc4f3c233ea1342d010f Mon Sep 17 00:00:00 2001 From: bcheidemann Date: Sat, 13 Nov 2021 20:36:03 +0000 Subject: [PATCH 4/4] docs: fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cd66390c..c5fc5c4c 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ module.exports = { --- **NOTE** -Previously it was recommended to access the `FilerWebpackPlugin` class by importing the main filer module. This was depracated due the [this issue](https://github.com/filerjs/filer/issues/790). For anyone using ***filer version 1.3.1 or earlier***, please import the plugin class like this: +Previously it was recommended to access the `FilerWebpackPlugin` class by importing the main filer module. This was depracated due [this issue](https://github.com/filerjs/filer/issues/790). For anyone using ***filer version 1.3.1 or earlier***, please import the plugin class like this: ```javascript var FilerWebpackPlugin = require('filer/src/webpack-plugin');