# Environment
# env
interface BalmEnvObject {
  isProd: boolean;
  isTest: boolean;
  isDev: boolean;
  inSSR: boolean;
  isMP: boolean; // New in 2.9.0
  inDesktopApp: boolean; // New in 3.1.0
}
env: BalmEnvObject
Balm workflow environment variable in Node.js.
- standard
env.isDevistruewhen runningbalmenv.isProdistruewhen runningbalm -porbalm --productionenv.isTestistruewhen runningbalm -torbalm --test
 - plus
env.inSSRistruewhen runningbalm -ssrorbalm --serverenv.isMPistruewhen runningbalm -mporbalm --miniprogramenv.inDesktopAppistruewhen runningbalm -electronorbalm --desktop-app
 
# workspace
workspace: string = process.cwd()
(Absolute path) Make sure any symlinks in the project folder are resolved.
π° For example:
// File: /path/to/workspace/balm.config.js
const path = require('path');
const workspace = path.resolve(__dirname);
module.exports = {
  workspace
  // Other Options...
};
Tips: Usually no need to set.
# inFrontend
inFrontend: boolean = true
Set project type.
truefor a static HTML projectfalsefor a dynamic language project (e.g. PHP framework)
π° For example:
module.exports = {
  inFrontend: true
  // Other Options...
};
# useDefaults
useDefaults: boolean = true
Enable balm default tasks.
π° For example:
const config = {
  useDefaults: false // Don't start balm default tasks
  // Other Options...
};
const api = (mix) => {
  // Custom tasks by API
};
module.exports = (balm) => {
  return {
    config,
    api
  };
};
π Refer to Custom Task API