waef-dev-webpack
webpack easy config for waef using webpack2
Last updated 3 years ago by ibyh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install waef-dev-webpack 
SYNC missed versions from official npm registry.

waef-dev-webpack

webpack easy config for waef. Only for webpack2

Install

$ npm install waef-dev-webpack
$ npm install webpack@2.2.0-rc.0 webpack-dev-server@2.2.0-rc.0

Usage

/*webpack.config.dev.js*/
var webpackUtil = require('waef-dev-webpack');
var configSet = webpackUtil.getConfig({
  // config here . detail see DefaultConfig
});
var babelConfig = configSet.babelConfig,
    webpackConfig = configSet.webpackConfig;
// other processing
module.exports = webpackConfig;


/*package.json*/
{
  "scripts": {
    "dev": "set APPRUN_ENV=dev && webpack-dev-server --config webpack.config.dev.js",
    "dev:hmr": "set APPRUN_ENV=dev_hmr && webpack-dev-server --hot --inline --config webpack.config.dev.js",
    "build": "webpack  --config webpack.config.proc.js"
  }
}
$ npm run dev

DefaultConfig

{
  'cwd': process.cwd(),
  'srcPath': './src',
  'host': '0.0.0.0',
  'port': 9090,
  'hmr': process.env.APPRUN_ENV && process.env.APPRUN_ENV.indexOf('hmr') > -1,
  'distPath': './dist',
  'publicPath': '/',
  'entry': ['./src/index'],
  'hasHash': true,
  'useCommon': true,
  'commonName': 'common',
  'proxy': {},
  'loaders': [],
  'plugins': []
}

Use Ant Design

/*in webpack.config.dev.js*/
var useAntd=require('waef-dev-webpack/dist/useAntd');
// get babelConfig and webpackConfig
useAntd(babelConfig,webpackConfig,{
  'cwd': process.cwd(),
  'hasHash': true,
  'used': false,    // using antd
  'theme': {}       // theme or theme path
});

License

MIT

Current Tags

  • 0.1.5                                ...           latest (3 years ago)

6 Versions

  • 0.1.5                                ...           3 years ago
  • 0.1.4                                ...           3 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |