Answer the question
In order to leave comments, you need to log in
Config.ts which contains local constants. How to implement?
In simple es6, you can easily implement a configuration file for the contents that are used in the project.
module.exports = {
THIS_IS_FOO: 'boo',
}
const { THIS_IS_FOO } = require('./config');
console.log(THIS_IS_FOO); // 'boo'
export const config = {
THIS_IS_FOO: 'boo',
}
import { THIS_IS_FOO } from './config';
[ts] Module has no exported member 'THIS_IS_FOO'
import * as config
import { config } from
Answer the question
In order to leave comments, you need to log in
I usually declare constants one by one, something like this:
export const CONSTANT_1 = '1';
export const CONSTANT_2 = '2';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question