On this page

Project Configuration

Used to declare configuration information when compiling the project. The configuration file ray.config.ts is located in the project root directory.

resolveAlias

Type: object

Module alias, which can be used to replace the module name or default path during build time. { '@': './src' } is supported by default.

- import Foo from '../../components/foo/index';
+ import Foo from '@/components/foo/index';

define

Type: object

Define global variables, which can be used to replace variable names during build time.

const config: RayConfig = {
  define: {
    'process.env.NODE_ENV': 'production',
  },
};

Example

import {RayConfig} from '@ray-js/types';

const config: RayConfig = {
  resolveAlias: {
    '@': './src',
  },
  define: {
    'process.env.NODE_ENV': 'production',
  },
};

export default config;