1.0.6 • Published 2 years ago
@jswork/craco-plugin-environment v1.0.6
craco-plugin-environment
Craco plugin for env.
installation
npm install @jswork/craco-plugin-environment
usage
import cracoPluginEnvironment from '@jswork/craco-plugin-environment';
// global.d.ts
declare global {
const APP_VARS: any;
}
// eslintrc.js
"globals": {
"APP_VARS": true
}
// craco.config.js
{
plugin: cracoPluginEnvironment,
options: {
vars: {
BUILD_DATETIME: new Date().toLocaleString('en-US', {
hour12: false,
timeZone: 'Asia/ShangHai',
}),
BUILD_VERSION: pkg.version,
},
},
}
license
Code released under the MIT license.