dist-bundler
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -21,5 +21,2 @@ "use strict"; | ||
outputFolder: "build/", | ||
infoJSON: { | ||
disabled: false, | ||
}, | ||
}; | ||
@@ -26,0 +23,0 @@ const readConfig = (path) => { |
@@ -35,5 +35,4 @@ "use strict"; | ||
...customConfig, | ||
infoJSON: config_1.defaultConfig.infoJSON, | ||
outputFolder: config_1.defaultConfig.outputFolder, | ||
}); | ||
}); |
{ | ||
"name": "dist-bundler", | ||
"version": "0.4.0", | ||
"description": "Combines buildt code in a directory to a single .js file.", | ||
"version": "0.4.1", | ||
"description": "Combines built code in a directory to a single .js file.", | ||
"bin": { | ||
@@ -6,0 +6,0 @@ "dist-bundler": "build/index.js" |
# dist-bundler | ||
Combines buildt code in a directory to a single .js file | ||
Combines built code in a directory to a single .js file. | ||
## Installing | ||
```shell | ||
npm install --save-dev dist-bundler | ||
``` | ||
## Building and testing | ||
This tool is built with typescript. In order to create a build run: | ||
```shell | ||
npm run build | ||
``` | ||
This will clean up and create a new build in `build/`. The command also copies relevant resources into the | ||
`build/` folder. | ||
When developing you can run the watch command in order to continously build the project when code is changed: | ||
```shell | ||
npm run watch | ||
``` | ||
In order to run tests the project needs to be built, then you can run the test command: | ||
```shell | ||
npm test | ||
``` | ||
## Usage | ||
When run the tool will dig through all files and sub folders in a given directory and combine all `.js` and `.css` files into a single `.js` file which loads all relevant files from a generated folder | ||
with scripts. The structure will look like this: | ||
``` | ||
build/ | ||
├─ static/ | ||
│ ├─ some-styling.css | ||
│ ├─ some-javascript.js | ||
│ ├─ some-polyfill.js | ||
├─ boot.js | ||
``` | ||
Configuration of where files will be collected from and where they will be outputted can be set in `./config.json`. The default configuration looks like this: | ||
```json | ||
{ | ||
"copyTasks": { | ||
"js": { | ||
"source": "dist/js/", | ||
"target": "js/" | ||
}, | ||
"styles": { | ||
"source": "dist/styles/", | ||
"target": "styles/" | ||
} | ||
}, | ||
"outputFolder": "build/" | ||
} | ||
``` | ||
`copyTasks`: Defines where to copy files from. | ||
- `js`: Defines source and target directory for `.js` files. | ||
- `css`: Defines source and target directory for `.css` files. | ||
`outputFolder`: Where the resulting files should be put. |
@@ -34,5 +34,4 @@ import test from "ava"; | ||
...customConfig, | ||
infoJSON: defaultConfig.infoJSON, | ||
outputFolder: defaultConfig.outputFolder, | ||
}); | ||
}); |
@@ -10,5 +10,2 @@ import { existsSync, readFileSync } from "fs-extra"; | ||
outputFolder?: string; | ||
infoJSON?: { | ||
disabled: boolean; | ||
}; | ||
}; | ||
@@ -33,5 +30,2 @@ | ||
outputFolder: "build/", | ||
infoJSON: { | ||
disabled: false, | ||
}, | ||
}; | ||
@@ -38,0 +32,0 @@ |
35133
71
756