Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meguminsama/dpacker
Webpack debundler
https://github.com/meguminsama/dpacker
Last synced: about 11 hours ago
JSON representation
Webpack debundler
- Host: GitHub
- URL: https://github.com/meguminsama/dpacker
- Owner: MeguminSama
- Created: 2021-07-30T02:13:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-12T02:06:37.000Z (over 1 year ago)
- Last Synced: 2024-11-02T02:17:05.850Z (14 days ago)
- Language: JavaScript
- Size: 40 KB
- Stars: 13
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DPacker
A webpack module splitter & beautifier
Originally designed for discord.. but can be used for pretty much anything..
## Usage
Make sure all your files are in one folder (no subfolders).
In this example, I will call it `assets-canary`Simply run...
```shell
npx dpacker ./assets-canary [-b] [-d]
```## Parameters
| Flag name | Shorthand | Default Value | Purpose |
| ----------------- | --------- | ------------- | ---------------------------------------------------------------- |
| --input | -i | | The input directory of .js files |
| --outDir | -o | ./out | The file to output the separated files |
| --manifest | -m | null | Generate a manifest file at the specified path |
| --verbose | -v | false | Verbose output |
| --beautify | -b | false | Beautify the outputted javascript files |
| --allowDuplicates | -d | false | Allows duplicate files to be generated when detected |
| --force | -f | false | If the output directory already exists, use this to overwrite it |
| --help | -h | | Show the help menu |## Flags:
`-b` is optional, and will auto-beautify the JS files as they're written.
`-d` is optional, and will write duplicate files if they share the ID. (By default, it ignores duplicate files as there's usually not any difference)
The files will be written into an `out` folder :)
## Features
Splits large webpack bundle files into their individual modules. Has de-duplication built in, but can be disabled with the `-d` flag.
Converts requires and module.exports to correct form, rather than webpack's (e, t, n) format
`require`s that point to a module ID will be mapped to `require("./moduleId.js")` for IDE compatibility, and should help with recompilation.