0.5.0 • Published 2 years ago

dist-bundler v0.5.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Build and test

dist-bundler

Combines built code in a directory to a single .js file.

Installing

npm install --save-dev dist-bundler

Building and testing

This tool is built with typescript. In order to create a build run:

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:

npm run watch

In order to run tests the project needs to be built, then you can run the test command:

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:

{
  "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.
0.5.0

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago