Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does vue configure the packaging of developer and build differently

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how vue configures the packaging of developer and build differently. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Different configurations for the packaging of developer and build

Most developers like to write the config of Vue in a file, which seems to be no problem, but as the environment changes, project optimization, WebPack plug-ins, and other targeted configurations come in, it will appear a little messy. At this time, you can consider doing a separate configuration, introducing a config to different environments through process.dev, and my configuration method is posted below. I created a new config directory under the root of the project, in which the common methods are unpackaged into a public.js and compiled according to the production environment and offline environment.

-- config--- dev.js--- build.js--- public.jsvue.config.js# code vue.config.jsconst devConfig = require ('. / config/dev') const buildConfig = require ('. / config/build') module.exports = process.env.NODE_ENV = = 'development'? DevConfig: buildConfig, thank you for reading! This is the end of this article on "how vue makes different configurations for developer and build packaging". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report