How to use @frontity/core - 4 common examples

To help you get started, weโ€™ve selected a few @frontity/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github frontity / frontity / packages / frontity / src / index.js View on Github external
const core = require('@frontity/core');

// Add comments
console.log(core.func('Frontity!'));
github frontity / frontity / packages / frontity / src / actions / build.ts View on Github external
export default async ({ development, target }) => {
  let build: Function;

  const options = {
    mode: development ? "development" : "production",
    target: target || "both"
  };

  try {
    build = require("@frontity/core").build;
  } catch (error) {
    const message =
      `Make sure that you are running ${chalk.green(
        "frontity"
      )} inside a Frontity project.\n` +
      `If so try installing ${chalk.green(
        "@frontity/core"
      )} again with ${chalk.green("npm i @frontity/core")}.\n`;
    errorLogger(error, message);
  }

  try {
    await build(options);
  } catch (error) {
    errorLogger(error);
  }
github frontity / frontity / packages / frontity / src / actions / dev.ts View on Github external
export default async ({ production, port, https, target, dontOpenBrowser }) => {
  let dev: Function;

  const options = {
    mode: production ? "production" : "development",
    port: parseInt(port, 10) || 3000,
    isHttps: !!https,
    target: target || "module",
    openBrowser: !dontOpenBrowser
  };

  try {
    dev = require("@frontity/core").dev;
  } catch (error) {
    const message =
      `Make sure that you are running ${chalk.green(
        "frontity"
      )} inside a Frontity project.\n` +
      `If so try installing ${chalk.green(
        "@frontity/core"
      )} again with ${chalk.green("npm i @frontity/core")}.\n`;
    errorLogger(error, message);
  }

  try {
    await dev(options);
  } catch (error) {
    errorLogger(error);
  }
github frontity / frontity / packages / frontity / src / actions / serve.ts View on Github external
export default async ({ port, https }) => {
  let serve: Function;

  const options = {
    port: parseInt(port, 10) || 3000,
    isHttps: !!https
  };

  try {
    serve = require("@frontity/core").serve;
  } catch (error) {
    const message =
      `Make sure that you are running ${chalk.green(
        "frontity"
      )} inside a Frontity project.\n` +
      `If so try installing ${chalk.green(
        "@frontity/core"
      )} again with ${chalk.green("npm i @frontity/core")}.\n`;
    errorLogger(error, message);
  }

  try {
    await serve(options);
  } catch (error) {
    errorLogger(error);
  }

@frontity/core

The core package of the Frontity framework.

Apache-2.0
Latest version published 2 years ago

Package Health Score

54 / 100
Full package analysis