Skip to content

Instantly share code, notes, and snippets.

@guilhermehn
Created April 8, 2016 02:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guilhermehn/9754c427c9cfc9c9cc863ecc096a7c04 to your computer and use it in GitHub Desktop.
Save guilhermehn/9754c427c9cfc9c9cc863ecc096a7c04 to your computer and use it in GitHub Desktop.
module.exports = {
// Your lib main file.
entry: './src/index.js',
// Where your lib will be used.
// Can be "web", "webworker", "node",
// "async-node", "node-webkit", "electron"
// If you use webpack everywhere you'll
// be fine with "node" most of the time
target: 'node',
resolve: {
extensions: ['', '.js']
},
output: {
path: './dist',
filename: 'index.js',
// The global name of your lib
library: 'MyLib',
libraryTarget: 'umd'
},
module: {
loaders: [
{
// Just normal babel loader
// config with es6 preset
test: /\.js$/,
loader: 'babel-loader',
query: {
presets: ['es2015']
},
exclude: /node_modules/
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment