Code Monkey home page Code Monkey logo

gm-webpack's Introduction

使用

js/index.js

package.json

"version": "1.0.0",

"scripts": {
  "start": "node ./node_modules/gm-webpack/start",
  "testing": "npm i; GIT_BRANCH=$BRANCH GIT_COMMIT=$COMMIT node ./node_modules/gm-webpack/testing",
  "deploy": "npm i; GIT_BRANCH=$BRANCH GIT_COMMIT=$COMMIT node ./node_modules/gm-webpack/deploy",
  "monitor": "node ./node_modules/gm-webpack/monitor"
}

webpack.config.js

const path = require('path');
const jsonconf = require('gm-jsonconf');
const siteConfig = jsonconf.parse(path.resolve(__dirname, 'config/deploy.json'));

const webpackConfig = require('gm-webpack/webpack.config.js');

const config = webpackConfig({
    publicPath: siteConfig.publicPath,
    port: siteConfig.port,
    proxy: siteConfig.proxy,
    projectShortName: 'manage'
});

module.exports = config;

webpack.config.dll.js

const path = require('path');
const jsonconf = require('gm-jsonconf');
const siteConfig = jsonconf.parse(path.resolve(__dirname, 'config/deploy.json'));
const webpackConfigDll = require('gm-webpack/webpack.config.dll.js');

const config = webpackConfigDll({
    publicPath: siteConfig.publicPath,
    dll: [
        'react', 'react-dom',
        'prop-types', 'classnames',

        'redux', 'react-redux', 'redux-thunk', 'redux-async-actions-reducers',

        'react-router', 'react-router-dom', 'history', 'query-string',

        'mobx', 'mobx-react',

        // 工具
        'lodash', 'moment', 'big.js'
    ]
});

module.exports = config;

webpack.config.monitor.js

const WebpackMonitor = require('webpack-monitor');
const path = require('path');
const config = require('./webpack.config');
const jsonconf = require('gm-jsonconf');
const siteConfig = jsonconf.parse(path.resolve(__dirname, 'config/deploy.json'));

config.plugins.push(new WebpackMonitor({
    launch: true,
    port: siteConfig.port + 1// default -> 8081
}));

module.exports = config;

gm-webpack's People

Contributors

chaoming-l avatar chenzesam avatar gesangs avatar liyatang avatar realwate avatar

Stargazers

 avatar

Watchers

 avatar  avatar  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.