just-build-it
A reusable builder to compile es6 and scss from a source directory into a destination directory
Last updated 9 months ago by sympletech .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install just-build-it 
SYNC missed versions from official npm registry.

just-build-it

A Zero Config builder to compile es6 and scss from a source directory into a destination directory

Meant to be Simple and no frills

Some configuration options exist however they are minimal, if you have specific needs building tool chains is actually pretty fun and WebPack is infiniatly configurable.

By default the builder will compile every .js file and .scss file (not starting with a _) in the src folder to the dist folder. This can be modified using the js and scss glob settings in the config file which is explained below.

Build Status

Install

npm install just-build-it --save-dev

Basic Usage

Add the following 2 scripts to your package.json

  "scripts": {
    "start": "just-build-it",
    "build": "just-build-it build"
  }

Create an /src folder in your project and write some modern javascript and .scss

run npm run build

A /dist folder should appear with the files you want

Watching and Serving

run npm run dev

A live reload server will start and watching will ensue.

Avialable just-build-it modes (triggered by adding as second command in the package.json task)

default - ["clean-dist", "copy-static-files", "watch-static-files", "compile-js", "watch-js", "compile-scss", "watch-scss", "web-server"]

build - ["clean-dist", "copy-static-files", "compile-js", "compile-scss"]

watch - ["watch-static-files", "watch-js", "watch-scss", "web-server"]

And each task (entries on the right) can be called by name as well

Additional configuration

create a config in the root of your project named

.just-build-it

{
    "run_server": true,
    "server_port": 3000,
    "server_root": "./dist",
    "builds": [
        {
            "src_path": "./src",
            "build_path": "./dist",
            "js_glob": "**/*.js",
            "scss_glob": "**/*.scss",
            "static_files_glob": [
                "/**/*.html",
                "/**/*.css",
                "/**/*.jpg",
                "/**/*.gif",
                "/**/*.png",
                "/**/*.svg"
            ]   
        }
    ]
  }

Placing multiple entries in the builds folder of the config will start multiple builders (good for projects with lots of files)

Using GLOB Arrays

Any of the globs can be provided an array allowing you more control over what files get handled in what way

for example:

    "js_glob": [
        "**/*.js",
        "!/3rdPartyLibs/**/*.js",
    ],
    "static_files_glob": [
        "/**/*.html",
        "/**/*.css",
        "/**/*.jpg",
        "/**/*.gif",
        "/**/*.png",
        "/**/*.svg",
        "/3rdPartyLibs/**/*.js",
    ]       

Under the hood

To compile JavaScript this toolchain is using Webpack with babel-loader and the following presets

['@babel/preset-env', 'react-app']

To compile SCSS this toolchain is using using gulp-sass

And it's SourceMaps are generated using gulp-sourcemaps as well

It's all wrapped in a few Gulp tasks

Motivation

We have many projects that have a collection of js and scss files in them that need to be compiled and copied in place. I found that there was alot of diffrent ways people were building these projects, and worse that each developer who added in their own build spent a lot of time doing it, and in many cases did not even understand how their builds worked.

This package is meant to make it symple to get started on projects, this build won't work for everything but it may work for alot of things

If you want to use it like webpack and have it build from a single entry point just adjust the js_glob in your config file

Current Tags

  • 0.3.24                                ...           latest (9 months ago)

40 Versions

  • 0.3.24                                ...           9 months ago
  • 0.3.23                                ...           9 months ago
  • 0.3.22                                ...           9 months ago
  • 0.3.21                                ...           9 months ago
  • 0.3.20                                ...           9 months ago
  • 0.3.19                                ...           9 months ago
  • 0.3.18                                ...           9 months ago
  • 0.3.17                                ...           9 months ago
  • 0.3.16                                ...           9 months ago
  • 0.3.15                                ...           9 months ago
  • 0.3.14                                ...           9 months ago
  • 0.3.13                                ...           9 months ago
  • 0.3.12                                ...           9 months ago
  • 0.3.11                                ...           9 months ago
  • 0.3.10                                ...           10 months ago
  • 0.3.9                                ...           10 months ago
  • 0.3.8                                ...           10 months ago
  • 0.3.7                                ...           10 months ago
  • 0.3.6                                ...           10 months ago
  • 0.3.5                                ...           10 months ago
  • 0.3.4                                ...           10 months ago
  • 0.3.3                                ...           10 months ago
  • 0.3.2                                ...           10 months ago
  • 0.3.1                                ...           10 months ago
  • 0.3.0                                ...           10 months ago
  • 0.2.3                                ...           10 months ago
  • 0.2.2                                ...           10 months ago
  • 0.2.1                                ...           10 months ago
  • 0.2.0                                ...           10 months ago
  • 0.1.9                                ...           10 months ago
  • 0.1.8                                ...           10 months ago
  • 0.1.7                                ...           a year ago
  • 0.1.6                                ...           a year ago
  • 0.1.5                                ...           a year ago
  • 0.1.4                                ...           a year ago
  • 0.1.3                                ...           a year ago
  • 0.1.2                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
  • 0.0.1                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (18)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |