首页 > 代码库 > webpack.js 复习笔记

webpack.js 复习笔记

1、最简单的命令

hello.js

function hello(str){
  alert(str)
}

 

webpack hello.js hello.bundl.js  //即把hello.js 压缩成 hello.bundle.js

技术分享

 

2、requrie

hello.js

require(‘./world.js‘)
function hello(str){
  alert(str)
}

world.js

function world(){
  return {
    
  }
}

 webpack hello.js hello.bundle.js

技术分享

 

webpack.js 复习笔记