How to use the strapi-admin.build function in strapi-admin

To help you get started, we’ve selected a few strapi-admin 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 strapi / strapi / packages / strapi / lib / commands / build.js View on Github external
env
      )}.\nMake sure the directory ${yellow(
        `./config/environments/${env}`
      )} exists`
    );
    process.exit(1);
  }

  const serverConfig = await loadConfigFile(envConfigDir, 'server.+(js|json)');

  const adminPath = _.get(serverConfig, 'admin.path', '/admin');
  const adminBackend = _.get(serverConfig, 'admin.build.backend', '/');

  console.log(`Building your admin UI with ${green(env)} configuration ...`);

  return strapiAdmin
    .build({
      dir,
      // front end build env is always production for now
      env: 'production',
      optimize: optimization,
      options: {
        backend: adminBackend,
        publicPath: addSlash(adminPath),
      },
    })
    .then(() => {
      process.exit();
    })
    .catch(err => {
      console.error(err);
      process.exit(1);

strapi-admin

Strapi Admin

SEE LICENSE IN LICENSE
Latest version published 2 years ago

Package Health Score

61 / 100
Full package analysis

Similar packages