From c2307aaeb81333f1ca15e1626a5154b4fe32e2d0 Mon Sep 17 00:00:00 2001 From: "3056762376@qq.com" <3056762376@qq.com> Date: Sat, 19 Nov 2022 12:21:29 +0800 Subject: [PATCH] changes --- .../复习webpack配置/dist/result.js | 134 ++++++++++++++++++ .../复习webpack配置/index.html | 13 ++ .../复习webpack配置/package.json | 12 ++ .../复习webpack配置/src/calc.js | 37 +++++ .../复习webpack配置/src/index.js | 11 ++ .../复习webpack配置/webpack.config.js | 8 ++ 6 files changed, 215 insertions(+) create mode 100644 11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/dist/result.js create mode 100644 11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/index.html create mode 100644 11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/package.json create mode 100644 11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/src/calc.js create mode 100644 11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/src/index.js create mode 100644 11-前端模块化开发/03-webpack模块化开发/02-webpack配置/复习webpack配置/webpack.config.js 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