# webpack-docs.zh-cn
**Repository Path**: khs1994-website/webpack-docs.zh-cn
## Basic Information
- **Project Name**: webpack-docs.zh-cn
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: CC-BY-4.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2019-11-02
- **Last Updated**: 2026-06-30
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
---
title: webpack
---
## 编写代码
__src/index.js__
```js
import bar from './bar';
bar();
```
__src/bar.js__
```js
export default function bar() {
//
}
```
## 使用 webpack 打包
__[Without config](https://youtu.be/3Nv9muOkb6k?t=21293)__ or provide custom __webpack.config.js__
```js
const path = require('path');
module.exports = {
entry: './src/index.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js'
}
};
```
__page.html__
```html
...
...
```
然后在命令行运行 `webpack` 就会创建 `bundle.js`。
## 让一切变得简单
__[立即开始](/guides/getting-started)__更多关于 webpack 核心概念的高级信息,请通过快速查阅__指南__部分,或深入__[概念](/concepts)__部分来了解。