webpack.config.js 613 B

12345678910111213141516171819202122
  1. var PROD = process.argv.indexOf('-p') >= 0;
  2. var webpack = require('webpack');
  3. module.exports = {
  4. plugins: [
  5. new webpack.DefinePlugin({
  6. 'typeof __DEV__': JSON.stringify('boolean'),
  7. __DEV__: PROD ? false : true
  8. })
  9. ],
  10. entry: {
  11. 'echarts': __dirname + '/index.js',
  12. 'echarts.simple': __dirname + '/index.simple.js',
  13. 'echarts.common': __dirname + '/index.common.js'
  14. },
  15. output: {
  16. libraryTarget: 'umd',
  17. library: 'echarts',
  18. path: __dirname + '/dist',
  19. filename: PROD ? '[name].min.js' : '[name].js'
  20. }
  21. };