summaryrefslogtreecommitdiffstats
path: root/webpack.config.js
blob: 25e5306a5cc9a4788c560bed9bf0aa480f41d5f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
'use strict';

var webpack = require('webpack');

var config = {

  entry: './lib/index',

  output: {
    path: './dist/',
    filename: 'react-textarea-autosize.min.js',
    library: 'ReactTextareaAutosize',
    libraryTarget: 'umd'
  },

  cache: false,
  debug: true,

  stats: {
    colors: true,
    reasons: true
  },

  plugins: [
    // new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
    // new webpack.optimize.UglifyJsPlugin({minimize: true})
  ],

  resolve: {
    extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx']
  },

  externals: [{
    "react": {
      root: "react",
      commonjs2: "react",
      commonjs: "react",
      amd: "react"
    }
  }, {
    "react/addons": {
      root: "react/addons",
      commonjs2: "react/addons",
      commonjs: "react/addons",
      amd: "react/addons"
    }
  }],

  module: {
    loaders: [{
      test: /\.css$/,
      loader: 'style-loader!css-loader!'
    }, {
      test: /\.jsx?$/,
      exclude: /node_modules/,
      loader: 'babel-loader'
    }]
  }
};

module.exports = config;