Last active
February 13, 2020 09:02
-
-
Save rkaw92/26760708957b9f9deccf169857a59fae to your computer and use it in GitHub Desktop.
Webpack config for bundling a dependency
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Library test</title> | |
</head> | |
<body> | |
<p id="datetime"></p> | |
<script src="dist/main.js"></script> | |
<script> | |
function displayTime() { | |
document.getElementById('datetime').textContent = myMoment().format(); | |
} | |
setInterval(displayTime, 1000); | |
displayTime(); | |
</script> | |
</body> | |
</html> |
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
module.exports = { | |
mode: 'production', | |
entry: './node_modules/moment/moment.js', | |
output: { | |
libraryTarget: 'var', | |
library: 'myMoment' | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment