1.0.6 • Published 4 years ago

build-n-inject v1.0.6

Weekly downloads
11
License
ISC
Repository
github
Last release
4 years ago

Build'n'Inject

This project was created because of an specific problem I had while implementing CI/CD in my web projects.

Getting started

Firstly install the the package.

npm i -D build-n-inject

Create the config json file according to the example below.

{
  "buildDir": "dist",
  "commands": {
    "develop": "npm run build:dev",
    "master": "npm run build:prod"
  },
  "environments": [
    {
      "name": "Development",
      "branch": "develop",
      "copyDir": "dev",
      "build": "npm run build:dev"
    },
    {
      "name": "QA",
      "branch": "master",
      "copyDir": "qa",
      "build": "npm run build:dev"
    },
    {
      "name": "Staging",
      "branch": "master",
      "copyDir": "stage",
      "build": "npm run build:prod",
      "fileReplacements": [
        [
          "src/params.json",
          "src/params-prod.json"
        ]
      ]
    },
    {
      "name": "Production",
      "branch": "master",
      "copyDir": "prod",
      "build": "npm run build:prod",
      "fileReplacements": [
        [
          "src/params.json",
          "src/params-prod.json"
        ]
      ]
    }
  ]
}

You can test the command locally using

node ./node_modules/build-n-inject/index.js

If it's alright you can add the command to you package.json

"scripts": {
  ...
  "build-n-inject": "node ./node_modules/build-n-inject/index.js"
  ...
},
1.0.6

4 years ago

1.0.2

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago