1 Star 0 Fork 0

khs1994-website / webpack-docs.zh-cn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
title
webpack

编写代码

__src/index.js__
import bar from './bar';

bar();
__src/bar.js__
export default function bar() {
  //
}

使用 webpack 打包

__[Without config](https://youtu.be/3Nv9muOkb6k?t=21293)__ or provide custom __webpack.config.js__
const path = require('path');

module.exports = {
  entry: './src/index.js',
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'bundle.js'
  }
};
__page.html__
<!doctype html>
<html>
  <head>
    ...
  </head>
  <body>
    ...
    <script src="dist/bundle.js"></script>
  </body>
</html>

然后在命令行运行 webpack 就会创建 bundle.js

让一切变得简单

__立即开始更多关于 webpack 核心概念的高级信息,请通过快速查阅__指南__部分,或深入概念__部分来了解。

空文件

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/khs1994-website/webpack-docs.zh-cn.git
git@gitee.com:khs1994-website/webpack-docs.zh-cn.git
khs1994-website
webpack-docs.zh-cn
webpack-docs.zh-cn
master

搜索帮助