diff --git a/11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/dist/result.js b/11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/dist/result.js new file mode 100644 index 0000000..57b43d2 --- /dev/null +++ b/11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/dist/result.js @@ -0,0 +1,134 @@ +/******/ (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] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = 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; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__calc__ = __webpack_require__(1); + +let n1=prompt("请输入第一个值") +let n2=prompt("请输入第二个值") +let r=prompt("请输入半径") +console.log(`这是两数进行相加的结果${__WEBPACK_IMPORTED_MODULE_0__calc__["b" /* add */](n1, n2) }`); +console.log(`这是两数进行相减的结果${__WEBPACK_IMPORTED_MODULE_0__calc__["g" /* sub */](n1, n2)}`); +console.log(`这是两数进行相乘的结果${__WEBPACK_IMPORTED_MODULE_0__calc__["d" /* mult */](n1, n2)}`); +console.log(`这是两数进行相除的结果${__WEBPACK_IMPORTED_MODULE_0__calc__["c" /* divi */](n1, n2)}`); +console.log(`这是两数进行求余的结果${__WEBPACK_IMPORTED_MODULE_0__calc__["f" /* rem */](n1, n2)}`); +console.log(`这是长方形/正方形的面积${__WEBPACK_IMPORTED_MODULE_0__calc__["e" /* rect_area */](n1, n2)}`); +console.log(`这是圆的面积${__WEBPACK_IMPORTED_MODULE_0__calc__["a" /* Area_of_circle */](r)}`); + +/***/ }), +/* 1 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return add; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return sub; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return mult; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return divi; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return rem; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return rect_area; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Area_of_circle; }); +function add(n1,n2){ + return n1+n2; +} +function sub(n1,n2){ + return n1-n2; +} +function mult(n1,n2){ + return n1*n2 +} +function divi(n1,n2){ + let t=0 + if(n1 + + + + + + Document + + + + + + \ No newline at end of file diff --git a/11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/package.json b/11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/package.json new file mode 100644 index 0000000..93c9dad --- /dev/null +++ b/11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/package.json @@ -0,0 +1,12 @@ +{ + "name": "webpack_study", + "version": "1.0.0", + "description": "", + "main": "webpack.config.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "serve":"webpack" + }, + "author": "", + "license": "ISC" +} diff --git a/11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/src/calc.js b/11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/src/calc.js new file mode 100644 index 0000000..ee34e6c --- /dev/null +++ b/11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/src/calc.js @@ -0,0 +1,37 @@ +function add(n1,n2){ + return n1+n2; +} +function sub(n1,n2){ + return n1-n2; +} +function mult(n1,n2){ + return n1*n2 +} +function divi(n1,n2){ + let t=0 + if(n1