init...
This commit is contained in:
commit
359a39dedc
|
|
@ -0,0 +1,8 @@
|
||||||
|
.idea
|
||||||
|
# 忽略所有子项目中的 dist 文件夹
|
||||||
|
*/dist/
|
||||||
|
*/dist/*
|
||||||
|
|
||||||
|
# 忽略所有子项目中的 node_modules 文件夹
|
||||||
|
*/node_modules/
|
||||||
|
*/node_modules/*
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
**初始化项目**
|
||||||
|
```shell
|
||||||
|
npm init -y
|
||||||
|
```
|
||||||
|
**安装webpack依赖(开发依赖)**
|
||||||
|
```shell
|
||||||
|
npm add -D webpack webpack-cli
|
||||||
|
```
|
||||||
|
**打包项目**
|
||||||
|
```shell
|
||||||
|
npx webpack
|
||||||
|
```
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
import m1 from './m1'
|
||||||
|
import m2 from './m2'
|
||||||
|
const a = 2;
|
||||||
|
console.log(a,'@@')
|
||||||
|
m1.m1Method()
|
||||||
|
m2.m2Method()
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
import $ from 'jquery'
|
||||||
|
export default {
|
||||||
|
m1Method() {
|
||||||
|
console.log('m1Method')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
export default {
|
||||||
|
m2Method() {
|
||||||
|
console.log('m2Method')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
module.exports = {
|
||||||
|
mode: "development",
|
||||||
|
entry: './src/index.js',
|
||||||
|
output: {
|
||||||
|
filename: 'bundle.js'
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue