Skip to content

Instantly share code, notes, and snippets.

@zenorocha
Last active July 20, 2018 06:56
Show Gist options
  • Save zenorocha/88db55b251af6f3df41c to your computer and use it in GitHub Desktop.
Save zenorocha/88db55b251af6f3df41c to your computer and use it in GitHub Desktop.
Bundling Clipboard.js distribution with Webpack
var Clipboard = require('clipboard');
{
"private": true,
"dependencies": {
"clipboard": "^1.5.1"
},
"devDependencies": {
"babel-core": "^5.8.30",
"babel-loader": "^5.3.2",
"webpack": "^1.12.1"
},
"scripts": {
"build": "webpack"
}
}
var path = require('path');
module.exports = {
entry: "./entry.js",
output: {
path: __dirname,
filename: "bundle.js"
},
module: {
loaders: [
{
test: /\.js$/,
include: [
path.resolve(__dirname, "src"),
path.resolve(__dirname, "node_modules/clipboard/src")
],
loader: 'babel'
}
]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment