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

Example Analysis of mp-vue compilation instruction

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the relevant knowledge of "mp-vue compilation instruction instance Analysis". The editor shows you the operation process through the actual case. The operation method is simple, fast and practical. I hope this article "mp-vue compilation instruction instance Analysis" can help you solve the problem.

First, let's look at the generation of different files.

"scripts": {"dev:wx": "node build/dev-server.js wx", "start:wx": "npm run dev:wx", "build:wx": "node build/build.js wx", "dev:swan": "node build/dev-server.js swan", "start:swan": "npm run dev:swan", "build:swan": "node build/build.js swan" "dev:tt": "node build/dev-server.js tt", "start:tt": "npm run dev:tt", "build:tt": "node build/build.js tt", "dev:my": "node build/dev-server.js my", "start:my": "npm run dev:my", "build:my": "node build/build.js my", "dev": "node build/dev-server.js wx" "start": "npm run dev", "build": "node build/build.js wx"}

Next we will take a look at how to achieve the generation of multiple types of Mini Program through instructions.

First of all, we see the bulid.js file, because through the above we see the entry through the bulid.js file, and then through the configuration file, determine the suffix of the instruction into wx and so on, and generate the corresponding file suffix.

Var fileExtConfig = {swan: {template: 'swan', script:' js', style: 'css', platform:' swan'}, tt: {template: 'ttml', script:' js', style: 'ttss', platform:' tt'}, wx: {template: 'wxml' Script: 'js', style:' wxss', platform: 'wx'}, my: {template:' axml', script: 'js', style:' acss', platform: 'my'}}

Distinguish the file by suffix to generate the suffix name of the corresponding file

Generate file code

Index: path.resolve (_ _ dirname, `. / dist/$ {fileExt.platform} / index.html`), assetsRoot: path.resolve (_ _ dirname,`. / dist/$ {fileExt.platform} `). That's all for mp-vue compilation instruction instance analysis. Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

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

Internet Technology

Wechat

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

12
Report