快速上手

基础准备

安装和使用

$ mkdir webpack-demos
$ cd webpack-demos
$ touch .gitignore README.md
$ npm init
$ touch entry.js index.html

entry.js

document.write("一起轻松学习webpack.");

index.html

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Webpack 完全教程</title>
</head>
<body>
  <script src="./bundle.js"></script>
</body>
</html>

安装和编译

$ npm install webpack -g
$ webpack entry.js bundle.js

编译信息

Hash: 07146fa86952be132cbc
Version: webpack 1.13.1
Time: 63ms
    Asset     Size  Chunks             Chunk Names
bundle.js  1.42 kB       0  [emitted]  main
   [0] ./entry.js 35 bytes {0} [built]

results matching ""

    No results matching ""