摘要:
一、Webpack官方解释 从本质上讲:webpage是一个现代的JavaScript应用的静态模块打包工具。(模块和打包) 为了可以正常运行,必须依赖node环境,node环境为了可以正常的执行很多代码,必须其中包含各种依赖的包。npm(node packages manager)工具 1.1 前 阅读全文
摘要:
一、需要在html代码中引用两个js文件,并且类型需要设置为module <script src="info.js" type="module"></script> <script src="main.js" type="module"></script> 二、export指令用于导出模块中的内容 阅读全文
摘要:
模块化有两个核心:导出和导入 CommonJS的导出: module.exports= { flag: true, text(a,b){ return a + b; }, demo(a, b){ return a * b; }} CommonJS的导入: //CommonJS模块 let { tes 阅读全文