Last active
July 20, 2018 06:56
-
-
Save zenorocha/88db55b251af6f3df41c to your computer and use it in GitHub Desktop.
Bundling Clipboard.js distribution with Webpack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Clipboard = require('clipboard'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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