https://github.com/theopenwebjp/webpack-helpers
Collection of webpack helpers for easily generating config.
https://github.com/theopenwebjp/webpack-helpers
loader nodejs webpack webpack-plugin webpack-plugins
Last synced: about 1 year ago
JSON representation
Collection of webpack helpers for easily generating config.
- Host: GitHub
- URL: https://github.com/theopenwebjp/webpack-helpers
- Owner: theopenwebjp
- License: mit
- Created: 2020-04-26T11:07:48.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-03-21T15:08:55.000Z (about 2 years ago)
- Last Synced: 2025-02-22T16:06:01.684Z (about 1 year ago)
- Topics: loader, nodejs, webpack, webpack-plugin, webpack-plugins
- Language: HTML
- Homepage:
- Size: 846 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Description
Collection of Webpack helper functions, rules, loaders, constants, etc.
## Usage
```bash
npm install @theopenweb/webpack-helpers
```
Each function can be found in the source code.
Only the main functions are found below:
```js
const WebpackHelpers = require('@theopenweb/webpack-helpers')
// Create basic/common config
module.exports = WebpackHelpers.Recipes.common(__dirname)
// Create basic/common rules
const rules = WebpackHelpers.Rules.common()
```
## Help
Create config:
```js
// webpack.config.js
const WebpackHelpers = require('@theopenweb/webpack-helpers')
module.exports = WebpackHelpers.Recipes.common(__dirname)
```
Production build script:
```json
{
"scripts": {
"build-production": "cross-env NODE_ENV=production webpack --mode production"
}
}
```
Development build script:
```json
{
"scripts": {
"build-development": "cross-env NODE_ENV=development webpack"
}
}
```
## Test
Testing is done using `npm run test`.
Only basic testing is done now. Please feel free to request improved testing.
## Notes
- "-p changed to --mode production": [Webpack when run in terminal it gives an "error error: unknown option '-p'"](https://stackoverflow.com/questions/65592541/webpack-when-run-in-terminal-it-gives-an-error-error-unknown-option-p)
- Changelog generation:
- [auto-changelog](https://github.com/CookPete/auto-changelog)
- Install: `npm i -g auto-changelog`
- Execute: `auto-changelog`
## Feedback
Feel free to contact about feedback.
If you have any helpers you would like to add, please get in contact.