2018-01-11 12:54:20 +01:00
|
|
|
const path = require('path');
|
|
|
|
module.exports = {
|
|
|
|
entry: './src/index.js',
|
|
|
|
output: {
|
|
|
|
path: path.resolve(__dirname, 'build'),
|
|
|
|
filename: 'index.js',
|
2018-01-17 06:28:01 +01:00
|
|
|
libraryTarget: 'umd'
|
2018-01-11 12:54:20 +01:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.js$/,
|
|
|
|
include: path.resolve(__dirname, 'src'),
|
|
|
|
exclude: /(node_modules|bower_components|build)/,
|
|
|
|
use: {
|
|
|
|
loader: 'babel-loader',
|
|
|
|
options: {
|
|
|
|
presets: ['env', 'react', 'stage-2']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
modules: [path.resolve(__dirname, 'src/'), 'node_modules', __dirname],
|
|
|
|
extensions: ['.js', '.jsx', '.scss'],
|
|
|
|
},
|
|
|
|
externals: {
|
|
|
|
'react': 'commonjs react'
|
|
|
|
}
|
|
|
|
};
|