@@ -1,5 +1 @@
-# 忽略所有同学的node_modules
-**/node_modules/
-# Editor directories and files
-.idea
-.vscode
+ChenMa/node_modules/
@@ -0,0 +1 @@
+(()=>{"use strict";sayHello()})();
@@ -1,11 +0,0 @@
-<!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 +0,0 @@
-(()=>{"use strict";const e={sayHello(){document.body.insertAdjacentHTML("beforeend","<h1>今天天气异常得好</h1>")}};({sayHello(){console.log("hello")}}).sayHello(),e.sayHello()})();
+(()=>{"use strict";sayHello(),sayHello()})();
@@ -6,5 +6,8 @@
"devDependencies": {
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
+ },
+ "scripts": {
+ "build": "webpack"
}
@@ -2,4 +2,5 @@ export default({
sayHello() {
console.log('hello')
-})
+})
+sayHello()
document.body.insertAdjacentHTML('beforeend', '<h1>今天天气异常得好</h1>')
+console.log('hello aaa')
@@ -0,0 +1,18 @@
+const path = require('path')
+module.exports = {
+ mode: 'production',
+ // entry: [
+ // './src/a1.js',
+ // './src/a2.js'
+ // ],
+ entry: {
+ hello1: './src/a1.js',
+ hello2: './src/a2.js'
+ output: {
+ filename: '[name]-[id]-[hash].js',
+ // filename: 'file5.js',
+ clean: true,
+ // path: path.resolve(__dirname, 'hello')
+ }
+}