process in not defined解决办法

这种问题大多出现在自建webpack配置时,未安装dotenv-webpack包所致

npm i dotenv-webpack --save-dev
// .env
DB_HOST=127.0.0.1
DB_PASSWORD=test1233
DB_USER=user1



// webpack.config.js
const Dotenv = require('dotenv-webpack');
 
module.exports = {
  ...
  plugins: [
    new Dotenv()
  ]
  ...
};


console.log(process.env.DB_HOST);
//127.0.0.1

另外dotenv给出了一些配置项

    new Dotenv({
        path: isProd ? 'env.production' : 'env.development', // load this now instead of the ones in '.env'
        safe: true, // load '.env.example' to verify the '.env' variables are all set. Can also be a string to a different file.
        allowEmptyValues: true, // allow empty variables (e.g. `FOO=`) (treat it as empty string, rather than missing)
        systemvars: true, // load all the predefined 'process.env' variables which will trump anything local per dotenv specs.
        silent: true, // hide any errors
        defaults: false, // load '.env.defaults' as the default values if empty.
        //prefix: 'ggw', // reference your env variables as 'import.meta.env.ENV_VAR'.
        /*
         * 默认为process.env.xxxx,如果修改了prefix,如ggw,那么使用时就要写成ggwxxxx
         * 如修改为ggw.,那么使用时就要写成ggw.xxxx
         */
      }),

path路径其实可以自定义,对应的文件名也可以自定义

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Preface vii This book provides a set of readings on the state-of-the-art and the state-of-the- practice of the Unified Modeling Language (UML) and the Unified Process (UP). UML is a language for specifying, visualizing, constructing and documenting software- intensive systems. It is a unifier of proven software modeling languages that appeared in the early 1990s. UML incorporates the object-oriented community’s con- sensus on core modeling concepts and includes an additional expressiveness to handle problems that previous languages (Booch, OMT, OOSE) did not fully address. It emerged in response to a call for a standard object-oriented and design method by the Object Management Group (OMG) in 1997. Currently, the OMG/UML standard is version 1.4 and the evolution of UML will result in version 2.0. The UML notation includes diagrams that provide multiple perspectives of the system under analysis or development. It is layered architecturally and organized by packages. The model’s elements are defined in terms of their abstract syntax, well- formed rules (using the Object Constraint Language and precise text) and precise text. The formalization of UML is still an open problem. Many works have been done to formalize parts of the language and it is difficult to see how to integrate the works in order to define a formal semantics for UML. Although UML does not prescribe any particular development process, various companies are working on processes to provide advice on the use of UML in the software development life cycle. The OMG presented the “Software Process Engineering Metamodel” (SPEM) as a standard in November 2001. This metamodel is used to describe a concrete software development process or a family of related software development processes that use the UML notation. SPEM has a four-layered architecture of modeling for describing performing process, process model, process metamodel and MetaObject facility. Sev- eral processes fit SPEM. The most popular of these is the Rational Unified Process (RUP), developed and marketed by Rational Software. It is a software development process based on UML that is use-driven, architecture-centered, iterative and risk- driven. It provides a disciplined approach to assigning tasks and responsibilities within a development organization. RUP is organized around four phases: inception, elabora- tion, construction and transition and core workflows: requirements, capture, analysis, design, implementation and test. Various industry sectors around the world use RUP in different applications: telecommunications, transportation, aerospace, defense, manu- facturing and financial services. UML and UP are having a significant impact on the software development indus- try. However, numerous practical difficulties have been detected with their use. As a result, they must evolve further by looking toward extension practitioners and re- viii searchers to address specific concerns, then incorporate their feedback. In this direc- tion, many innovations are concerned with the development of new theories and prac- tices that are required to clarify and to make precise its semantics and reasons underly- ing properties of UML models. New theories and practices also transform software modeling and designs into code and enable object-oriented visual modeling tool interoperability. There are still important issues to be solved in a satisfactory way. Techniques that currently exist in UML CASE tools provide little support for validating models in the design stages and are insufficient for completed, automated code generation. Little work has been done in order to investigate the use of well-proven and accepted re- quirements, techniques and models for the business and requirements of UP models. Some problems have been detected in the process of MDA methods that require flex- ible code generation mechanisms. Modeling of a performance-oriented, parallel and distributed application in UML is still an open problem. This book collects insightful contributions from both industry and academia, illustrating how UML can be used, identifying open problems with UML and UP and suggesting solutions. The different chapters present perspectives on the UML and UP with respect to the following topics: • Extensions and restrictions of UML and UP, • Business process and modeling, • Semantics, • Mapping of UML models to frameworks, databases, formal languages and pro- gramming languages, • Software components, • Profiles, • Security. As an edited collection, this book should be of interest to practitioners, research- ers and instructors of UML and UP.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值