New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

min-app-script

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

min-app-script

min-app-pack 小程序打包

latest
npmnpm
Version
1.0.10
Version published
Maintainers
1
Created
Source

概述

用于支付宝小程序编译

  • less
  • sass
  • es6+
  • ts
  • 代码压缩
  • 本地 mock

script-config 配置文件

module.exports = {
  entry: 'src', // 项目入口目录
  output: 'dist', // 项目打包存放目录
  targets: { // babel 编译生成的版本 https://babeljs.io/docs/en/babel-preset-env#targets
    chrome: "58",
  },
  keep: /(node_modules)|(\.mini-ide)|(mini\.project\.json)/, // 打包时不删除的文件 https://webpack.docschina.org/configuration/output/#outputclean
  mockPort: false, // 默认设置为false关闭mock, 如果设置为mock: 7000 那么 http://localhost:7000 可以访问到mock数据
  webpackConfig: {}, // 你的 webpack 配置
}

mock

读取 mock/index.js 文件内容产生mock,端口号读取配置,默认关闭。
mock/index.js 内容如下
参考 https://www.expressjs.com.cn/starter/hello-world.html
module.exports = (app) => {
  app.post('/home', (req, res) => {
    res.json({
      test: 'home'
    });
  })

  app.get('/', (req, res) => {
    res.json({
      test: 'hello'
    });
  })
};
run dev // 启动编译,eslint检测,不压缩样式和js
run build // 代码压缩

脚手架生成 https://www.npmjs.com/package/min-app-pack

Keywords

min-app-script

FAQs

Package last updated on 20 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts