Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue #790 #793

Merged
merged 4 commits into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 [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()`).

Expand Down
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
};

Expand Down
3 changes: 3 additions & 0 deletions webpack/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
FilerWebpackPlugin: require('../src/webpack-plugin'),
};