Skip to content

Instantly share code, notes, and snippets.

@TimMikeladze
Last active October 30, 2016 10:24
Show Gist options
  • Save TimMikeladze/7c96ff7da844a3e9339d71ad5de27162 to your computer and use it in GitHub Desktop.
Save TimMikeladze/7c96ff7da844a3e9339d71ad5de27162 to your computer and use it in GitHub Desktop.
const path = require('path');
const nodeExternals = require('webpack-node-externals');
module.exports = {
entry: './src/index.js',
target: 'node',
externals: [nodeExternals()],
devtool: 'eval-source-map',
output: {
path: path.join(__dirname, '/lib'),
filename: 'index.js',
library: 'package-name',
libraryTarget: 'umd',
},
modulesDirectories: [
'src',
'node_modules',
],
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
},
],
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment