webpack.config.js
const path = require("path");
module.exports = {
entry: path.resolve(__dirname, "./src/index.js"),
output: {
path: path.resolve(__dirname, "dist"),
filename: "index.js",
libraryTarget: "umd"
},
externals: [
{
react: {
root: "React",
commonjs2: "react",
commonjs: "react",
amd: "react"
}
}
],
module: {
loaders: [
{
use: "babel-loader",
test: /\.js$/,
exclude: /node_modules/
}
]
}
};