project-scripts v1.1.1-rc
Project-Scripts
Create React apps with no build configuration. It also supports custom build configurations, and with a mix of raw and custom configurations
创建没有build配置的React应用程序。 支持自定义构建配置,以及原始和自定义配置的组合
Quick Overview
npm install project-scripts -D
project-scripts start
Installation
npm install project-scripts -D
project-scripts start
or
project-scripts build
Directory
After package already installed, to create directory for configuration files of webpack in the project root directory. like this.
当包安装完成后,在根目录下创建project-scripts目录,放置webpack配置文件。如下。
... project-root ...
|----- node_modules
|---- <project-scripts>
|----- public
|----- src
package.json
... ...
How To Use
In the "project-scripts" directory. create webpack configs files. There are 3 optional files : dev.js development-mode file bin.js publish-build-mode file server.js devServer-config file
在“project-scripts”目录下放置webpack工程化脚本。 脚本有三个选择:dev.js 开发模式配置文件 bin.js 发布模式配置文件 server.js devServer配置文件
... project-scripts ...
| -- project-scripts
| -- dev.js
| -- bin.js
| -- server.js
... ...
Use commonJS to expose custom configuration items. and system will merge custom items to default items, if there has the default configurations, it will override the default configuration.
使用commonJS方式暴露自定义的配置项,系统将会合并这些项目到默认配置。如果相同则会覆盖默认配置。
Run Scripts
In the package.json config scripts, use : project-scripts 配置package.json scripts 使用 project-scripts <模式> 指令
Note: As of now, only open dev and bin two modes 截至目前只开放了dev与bin两种模式
了解更多关于js包管理工具: https://www.npmjs.com/ or https://yarnpkg.com/zh-Hans/
了解更多关于webpack工程化的内容: https://webpack.js.org/
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago