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

@mini-code/env-scripts

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mini-code/env-scripts

React 工程化构建环境

latest
Source
npmnpm
Version
0.1.8
Version published
Maintainers
0
Created
Source

前端 React 工程脚手架

1. 使用

1.1. 安装

npm i @mini-code/env-scripts --dev
# or
yarn add @mini-code/env-scripts -D

1.2. 添加到 package.json 的 scripts 中

{
  "scripts": "minictl start"
}

2. 配置

在工程目录创建 .mini-scripts-config.js

module.exports = {
  paths: {
    "srcDir": "src",
    "appIndexJs": "index",
    "appBuildDir": "dist",
    "appHtml": "public/index.html",
    "deployHtml": "public/deploy.html"
  },
  // 给 devServer 的 options
  devServerOptions: {},
  // webpack 的 options
  // 覆盖默认提供的 webpack config
  webpackConfig: {
    output: {
      publicPath: './'
    },
    externals: {
      react: 'React'
    }
  },
  // 完全替代默认的 webpack 配置
  webpackConfigRaw: {},
  preRun: () => {
    // 启动前生命周期函数
  }
}

Keywords

react

FAQs

Package last updated on 02 Nov 2024

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