Guest User

Untitled

a guest
Mar 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. import _ from 'lodash';
  2. import printMe from './print.js';
  3.  
  4.  
  5. function component() {
  6. var element = document.createElement('div');
  7. var btn = document.createElement('button');
  8.  
  9. // Lodash, now imported by this script
  10. element.innerHTML = _.join(['Hello', 'webpack'], ' ');
  11.  
  12. btn.innerHTML = 'click and check console';
  13. btn.onclick = printMe;
  14.  
  15. element.appendChild(btn);
  16.  
  17. return element;
  18. }
  19.  
  20. document.body.appendChild(component());
  21.  
  22. export default function printMe() {
  23. consoe.log('Called from print.js');
  24. }
  25.  
  26. {
  27. "name": "my-webpack-4-proj",
  28. "version": "1.0.0",
  29. "description": "",
  30. "main": "index.js",
  31. "mode": "development",
  32. "scripts": {
  33. "dev": "webpack --mode development",
  34. "build": "webpack --mode production",
  35. "watch": "webpack --watch",
  36. "test": "echo "Error: no test specified" && exit 1"
  37. },
  38. "keywords": [],
  39. "author": "",
  40. "license": "ISC",
  41. "devDependencies": {
  42. "clean-webpack-plugin": "^0.1.19",
  43. "css-loader": "^0.28.11",
  44. "csv-loader": "^2.1.1",
  45. "file-loader": "^1.1.11",
  46. "html-webpack-plugin": "^3.0.6",
  47. "style-loader": "^0.20.3",
  48. "webpack": "^4.1.1",
  49. "webpack-cli": "^2.0.12",
  50. "xml-loader": "^1.2.1"
  51. },
  52. "dependencies": {
  53. "express": "^4.16.3",
  54. "lowdash": "^1.2.0"
  55. }
  56. }
Add Comment
Please, Sign In to add comment