Git Product home page Git Product logo

beefly-frame's Introduction

app-web

App端中的web页面,根目录下每个目录为一个单独的模块(除common外, 该目录中存放所有模块中使用的公共资源。),单独开发。

切换模块

1.手动切换,修改./config.js中属性projectDir值,指定到相应的目录。

module.exports = {
	// 当前模块
	projectDir: "mid-autumn",
}

2、命令切换

// 中秋活动
node script.js -P mid-autumn

// 邀请好友活动
node script.js -P invite-friends

To run

  • You'll need to have git and node installed in your system.
  • Fork and clone the project:
git clone http://59.110.52.154:82/html/app-web.git
  • Then install the dependencies:
npm install
  • Run development server:
npm start
npm run dev

Open the web browser to http://localhost:3000/

To test

To run unit tests:

npm test

Tests come bundled with:

  • Jest
  • Enzyme
  • React Test Utils
  • React Test Renderer

To build the production package

npm run build

Eslint

There is a .eslint.yaml config for eslint ready with React plugin.

To run linting, run:

npm run lint

App端调试:

html页面中增加下面代码,会在页面中出现调试功能,功能类似chrome开发者工具。 开发模式默认已添加,如果生产环境中需要调度,则手动在index.html中添加下面两行代码。

<script src="//cdn.bootcss.com/eruda/1.2.4/eruda.min.js"></script>
<script>eruda.init();</script>

项目参数配置信息

./common/config.js文件中,来配置开发环境与生产环境下不同的参数。

// 开发环境
const development = {
	env: 'development',
	mifengApp: 'http://test.api.mmuu.com/mifeng/app/',
	...
};


// 生产环境
const production = {
	env: 'production',
	mifengApp: 'http://api.mmuu.com/mifeng/app/',
	...
};

export default development;

使用如下命令,切换不同环境:

// 切换开发环境
node script.js -d

// 切换生产环境
node script.js -p

beefly-frame's People

Stargazers

李星雲 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.