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

Readme documentation #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# @easy-webpack/config-json
__NOTE__: The config is only required in webpack 1. See [this issue](https://github.com/webpack/webpack/issues/3363) for detail.

Load in JSON files using [json-loader](https://github.com/webpack/json-loader).


# Installation
```
npm install --save-dev @easy-webpack/config-json
```
[easy-webpack](https://github.com/easy-webpack/core) is also required.

# Usage
```js
// webpack.config.js
const generateConfig = require('@easy-webpack/core').generateConfig;

const baseConfig = { ... }; // project-specific config like the entry file

module.exports = generateConfig(
baseConfig,

require('@easy-webpack/config-json')
({ /* Options object */ exclude: /(node_modules|bower_components)/ })
);

// This config will allow webpack bundle to load in JSON files
```

# Options
### exclude
Type: `(Array of) Webpack Exclude Object` Default: `node_modules`

Files to be excluded from being proceed by json-loader.

Check [webpack documentation](https://webpack.js.org/configuration/module/#condition) on how to write valid exclude files.