@olenbetong/component-config

Utility functions for shared configuration between components.

Component configuration has moved to the shared folder in ui-kit
Last updated 5 months ago by bjornarvh .
MIT · Original npm · Tarball · package.json
$ cnpm install @olenbetong/component-config 
SYNC missed versions from official npm registry.

Component configuration

Utility functions for shared configuration between components.

Install

npm install --save-dev @olenbetong/component-config

Rollup configuration

getRollupConfig takes input, output and options and creates a full rollup configuration with plugins. The output will be put into the dist folder in the package.

Options available are:

  • input - Path to the file that should be processed
  • fileName - Filename of the output file without extension and path
  • libraryName - Name of the global variable created in UMD builds
  • format - A format supported by Rollup, or esm.browser, which creates an ESM build, but using React and ReactDOM from the window object
  • production - Boolean. Adds minifying.

Example rollup.config.js from the Spinner component. With this configuration, you can run rollup -c to create non-minified versions, and rollup -c --configProd to create minified versions:

import { getRollupConfig } from "@olenbetong/component-config";

export default function buildConfig(commandLineArgs) {
  const production = commandLineArgs.configProd === true;
  const common = {
    fileName: "spinner",
    input: "./src/index.js",
    libraryName: "ReactSpinner",
    production
  };

  return [
    getRollupConfig({ ...common, format: "umd" }),
    getRollupConfig({ ...common, format: "esm" }),
    getRollupConfig({ ...common, format: "esm.browser" })
  ];
}

Common SASS configuration

SASS variables are available in the style folder.

@import "~@olenbetong/component-config/style/variables";

.myComponent {
  background-color: $brand-primary;
}

Current Tags

  • 1.3.0                                ...           latest (5 months ago)

12 Versions

  • 1.3.0 [deprecated]           ...           5 months ago
  • 1.2.6 [deprecated]           ...           5 months ago
  • 1.2.5 [deprecated]           ...           5 months ago
  • 1.2.4 [deprecated]           ...           5 months ago
  • 1.2.3 [deprecated]           ...           6 months ago
  • 1.2.2 [deprecated]           ...           6 months ago
  • 1.2.1 [deprecated]           ...           6 months ago
  • 1.2.0 [deprecated]           ...           6 months ago
  • 1.1.1 [deprecated]           ...           6 months ago
  • 1.1.0 [deprecated]           ...           7 months ago
  • 1.0.1 [deprecated]           ...           7 months ago
  • 1.0.0 [deprecated]           ...           7 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 13
Last Day 0
Last Week 1
Last Month 0
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |