1.1.0 • Published 4 years ago

@brickjs/devops v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

@brickjs/devops

A collection of opinionated common tools, scripts and configurations to build, test and deploy applications. With @brickjs/devops, each project does not need to install individual dependencies thus it greatly shortens the devDependencies entries.

Quick Start

Installation

npm install @brickjs/devops --save-dev

Sample usage in an application scripts entry:

{
    "scripts": {
      "build": "brickjs-devops-scripts build",
      "build:watch": "brickjs-devops-scripts tsc --watch",
      "test": "brickjs-devops-scripts test"
    }
}

Available Script

ScriptDescription
buildRun tsc
testRun jest
tscTypescript
jestJest
webpackWebpack
webpack-dev-serverWebpack Dev Server

Common Config

tsconfig.json

{
  "extends": "@brickjs/devops/config/tsconfig.base.json",
  "compilerOptions": {
    "outDir": "./lib/",
    "rootDir": "./src/"
  },
  "include": [
    "./src/**/*"
  ]
}

jest.config.js

const baseConfig = require('@brickjs/devops/config/jest.config.base');

module.exports = {
  ...baseConfig,
};

webpack.config.js

const webpack = require('webpack');
const { createAppConfig } = require('@brickjs/devops/config/webpack.create.config');
const packageVersion = require('./package.json').version;
const HTMLWebpackPlugin = require('html-webpack-plugin');

module.exports = [
  createAppConfig({
    rootDir: __dirname,
    packageVersion,
    plugins: [
      new HTMLWebpackPlugin({
        template: 'template/template.html',
      }),
    ],
    entry: {
      'app': ['./src/index.tsx'],
    },
    optimization: {
      splitChunks: {
        chunks: 'all',
      },
    },
  }),
];