@electrojet/core

0.1.6 • Public • Published

Electrojet Web Core

npm version

A CLI for running applications generated by create-electrojet

Commands

1. Start

Starts a development server using webpack.

core-scripts start --port=4567

Port is defaulted to 4567.

2. Build

Builds using webpack build configuration to the dist folder

core-scripts build

Node API

1. Start

Starts the webpack dev server in development mode.

Returns a promise on completion. Fails loudly on error.

const core = require("@electrojet-core"); 

// Your function that runs on start command
async function start() {
  await core.start({
    flags: {
      port: 4567, // Port for developement server
    },
    plugins: [
      {
        resolve: (env, context, options) => {} // Same as plugins in electrojet.config.js
      }
    ]
  });
}

2. Build

Runs webpack build.

Returns a promise on completion. Fails loudly on error.

const core = require("@electrojet-core"); 

// Your function that runs on build command
async function build() {
  await core.build({
    plugins: [
      {
        resolve: (env, context, options) => {} // Same as plugins in electrojet.config.js
      }
    ]
  });
}

3. getConfig

Gets the configuration object defined in electrojet.config.js at root.

Returns a Promise with options.

const { getOptions } = require('@electrojet/core');

async function doSomething() {
  const options = await getConfig;
}

What are the default options?

Readme

Keywords

Package Sidebar

Install

npm i @electrojet/core

Weekly Downloads

1

Version

0.1.6

License

MIT

Unpacked Size

15.3 kB

Total Files

18

Last publish

Collaborators

  • agney