Browse Source

第二次打包

machen 1 năm trước cách đây
mục cha
commit
9e71fb9d6c
5 tập tin đã thay đổi với 27 bổ sung2 xóa
  1. 11 0
      ChenMa/dist/index.html
  2. 1 1
      ChenMa/dist/main.js
  3. 5 0
      ChenMa/src/a1.js
  4. 5 0
      ChenMa/src/a2.js
  5. 5 1
      ChenMa/src/index.js

+ 11 - 0
ChenMa/dist/index.html

@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+  <meta charset="UTF-8">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <title>Document</title>
+</head>
+<body>
+  <script defer src="./main.js"></script>
+</body>
+</html>

+ 1 - 1
ChenMa/dist/main.js

@@ -1 +1 @@
-console.log("你好webpack");
+(()=>{"use strict";const e={sayHello(){document.body.insertAdjacentHTML("beforeend","<h1>今天天气异常得好</h1>")}};({sayHello(){console.log("hello")}}).sayHello(),e.sayHello()})();

+ 5 - 0
ChenMa/src/a1.js

@@ -0,0 +1,5 @@
+export default({
+  sayHello() {
+    console.log('hello')
+  }
+})

+ 5 - 0
ChenMa/src/a2.js

@@ -0,0 +1,5 @@
+export default({
+  sayHello() {
+    document.body.insertAdjacentHTML('beforeend', '<h1>今天天气异常得好</h1>')
+  }
+})

+ 5 - 1
ChenMa/src/index.js

@@ -1 +1,5 @@
-console.log('你好webpack')
+import a1 from './a1'
+import a2 from './a2'
+
+a1.sayHello()
+a2.sayHello()