2015-12-04 4 views
14

Lider/******/yorum ile neler var WebPack çıktıda üretiyor? WebPack ile ilgili kodu işaretlemek mi yoksa daha fazlası var mı?Webpack neden her satırdan önce garip yorumları veriyor?

/******/ (function(modules) { // webpackBootstrap 
/******/ // The module cache 
/******/ var installedModules = {}; 

/******/ // The require function 
/******/ function __webpack_require__(moduleId) { 

/******/  // Check if module is in cache 
/******/  if(installedModules[moduleId]) 
/******/   return installedModules[moduleId].exports; 

/******/  // Create a new module (and put it into the cache) 
/******/  var module = installedModules[moduleId] = { 
/******/   exports: {}, 
/******/   id: moduleId, 
/******/   loaded: false 
/******/  }; 

/******/  // Execute the module function 
/******/  modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 

/******/  // Flag the module as loaded 
/******/  module.loaded = true; 

/******/  // Return the exports of the module 
/******/  return module.exports; 
/******/ } 


/******/ // expose the modules object (__webpack_modules__) 
/******/ __webpack_require__.m = modules; 

/******/ // expose the module cache 
/******/ __webpack_require__.c = installedModules; 

/******/ // __webpack_public_path__ 
/******/ __webpack_require__.p = ""; 

/******/ // Load entry module and return exports 
/******/ return __webpack_require__(0); 
/******/ }) 
/************************************************************************/ 
/******/ ([ 
/* 0 */ 
/***/ function(module, exports) { 

    document.write('I think it works!'); 


/***/ } 
/******/ ]); 
+0

Evet - webpack ile ilgili kodu işaretler. –

cevap

1

WebPack bunları tanımlamak için modüller ve parçalar kimlikleri verir:

Burada basit çıkış örnek. Senaryonuzu en aza indirmek için UglifyJs eklentisini kullanmanız önerilir (new webpack.optimize.UglifyJsPlugin()).

Betiğin nasıl en aza indirileceği ve daha da optimize edileceği hakkında bilgi bulabileceğiniz optimization sayfasını okumanızı öneririz.