WEB前端高级工程师养成计划『全修精英特训』【JS++】
2023-03-11 10:46 作者:bili_1534047163 | 我要投稿
unction(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){const moduleA = require("./moduleA");console.log(moduleA);},{"./moduleA":2}],2:[function(require,module,exports){module.exports = "hello world";},{}]},{},[1]);
2、rollup
tree shaking概念:对esmodule模块进行静态分析和处理,已经删除无用代码
npm install --save-dev rollup // 安装