Compare commits
2 Commits
7e8a6f07c2
...
c103c0157f
| Author | SHA1 | Date | |
|---|---|---|---|
| c103c0157f | |||
| 359a39dedc |
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
.idea
|
||||
# 忽略所有子项目中的 dist 文件夹
|
||||
*/dist/
|
||||
*/dist/*
|
||||
|
||||
# 忽略所有子项目中的 node_modules 文件夹
|
||||
*/node_modules/
|
||||
*/node_modules/*
|
||||
12
01/README.md
Normal file
12
01/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
**初始化项目**
|
||||
```shell
|
||||
npm init -y
|
||||
```
|
||||
**安装webpack依赖(开发依赖)**
|
||||
```shell
|
||||
npm add -D webpack webpack-cli
|
||||
```
|
||||
**打包项目**
|
||||
```shell
|
||||
npx webpack
|
||||
```
|
||||
1372
01/package-lock.json
generated
Normal file
1372
01/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
20
01/package.json
Normal file
20
01/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "01",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"build": "webpack --config webpack.config.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"webpack": "^5.93.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"jquery": "^3.7.1"
|
||||
}
|
||||
}
|
||||
6
01/src/index.js
Normal file
6
01/src/index.js
Normal file
@@ -0,0 +1,6 @@
|
||||
import m1 from './m1'
|
||||
import m2 from './m2'
|
||||
const a = 2;
|
||||
console.log(a,'@@')
|
||||
m1.m1Method()
|
||||
m2.m2Method()
|
||||
6
01/src/m1.js
Normal file
6
01/src/m1.js
Normal file
@@ -0,0 +1,6 @@
|
||||
import $ from 'jquery'
|
||||
export default {
|
||||
m1Method() {
|
||||
console.log('m1Method')
|
||||
}
|
||||
}
|
||||
5
01/src/m2.js
Normal file
5
01/src/m2.js
Normal file
@@ -0,0 +1,5 @@
|
||||
export default {
|
||||
m2Method() {
|
||||
console.log('m2Method')
|
||||
}
|
||||
}
|
||||
8
01/webpack.config.js
Normal file
8
01/webpack.config.js
Normal file
@@ -0,0 +1,8 @@
|
||||
module.exports = {
|
||||
mode: "development",
|
||||
entry: './src/index.js',
|
||||
output: {
|
||||
filename: 'bundle.js'
|
||||
},
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user