-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from gwuhaolin/webpack4
support Webpack4
- Loading branch information
Showing
238 changed files
with
4,229 additions
and
6,592 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"arrowParens": "always" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# AutoWebPlugin 可以自定义输出的html文件名称 | ||
# AutoWebPlugin 可以自定义输出的 html 文件名称 | ||
|
||
`AutoWebPlugin` 可以自定义输出的html文件名称的逻辑,只需给 filename 传一个 function 即可。 | ||
这个函数定义为:`(pageName)=> newPageName`, | ||
`AutoWebPlugin` 可以自定义输出的 html 文件名称的逻辑,只需给 filename 传一个 function 即可。这个函数定义为:`(pageName)=> newPageName`, | ||
|
||
加入配置如下,有一个 page 的目录名称为`login`,则`pageName='login'`,实际输出的 html 文件名称为`login++.html`。 | ||
|
||
加入配置如下,有一个page的目录名称为`login`,则`pageName='login'`,实际输出的html文件名称为`login++.html`。 | ||
```js | ||
new AutoWebPlugin("./src/", { | ||
filename: pageName => `${pageName}++` | ||
new AutoWebPlugin('./src/', { | ||
filename: (pageName) => `${pageName}++`, | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,61 @@ | ||
/******/ (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, exports, __webpack_require__) { | ||
|
||
module.exports = __webpack_require__(1); | ||
|
||
|
||
/***/ }), | ||
/* 1 */ | ||
/***/ (function(module, exports) { | ||
|
||
alert('page home'); | ||
|
||
/***/ }) | ||
/******/ ]); | ||
!(function(e) { | ||
var t = {}; | ||
function r(n) { | ||
if (t[n]) return t[n].exports; | ||
var o = (t[n] = { i: n, l: !1, exports: {} }); | ||
return e[n].call(o.exports, o, o.exports, r), (o.l = !0), o.exports; | ||
} | ||
(r.m = e), | ||
(r.c = t), | ||
(r.d = function(e, t, n) { | ||
r.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: n }); | ||
}), | ||
(r.r = function(e) { | ||
'undefined' != typeof Symbol && | ||
Symbol.toStringTag && | ||
Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }), | ||
Object.defineProperty(e, '__esModule', { value: !0 }); | ||
}), | ||
(r.t = function(e, t) { | ||
if ((1 & t && (e = r(e)), 8 & t)) return e; | ||
if (4 & t && 'object' == typeof e && e && e.__esModule) return e; | ||
var n = Object.create(null); | ||
if ( | ||
(r.r(n), | ||
Object.defineProperty(n, 'default', { enumerable: !0, value: e }), | ||
2 & t && 'string' != typeof e) | ||
) | ||
for (var o in e) | ||
r.d( | ||
n, | ||
o, | ||
function(t) { | ||
return e[t]; | ||
}.bind(null, o) | ||
); | ||
return n; | ||
}), | ||
(r.n = function(e) { | ||
var t = | ||
e && e.__esModule | ||
? function() { | ||
return e.default; | ||
} | ||
: function() { | ||
return e; | ||
}; | ||
return r.d(t, 'a', t), t; | ||
}), | ||
(r.o = function(e, t) { | ||
return Object.prototype.hasOwnProperty.call(e, t); | ||
}), | ||
(r.p = ''), | ||
r((r.s = 5)); | ||
})({ | ||
4: function(e, t) { | ||
alert('page home'); | ||
}, | ||
5: function(e, t, r) { | ||
e.exports = r(4); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,63 @@ | ||
/******/ (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 = 2); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */, | ||
/* 1 */, | ||
/* 2 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
|
||
module.exports = __webpack_require__(3); | ||
|
||
|
||
/***/ }), | ||
/* 3 */ | ||
/***/ (function(module, exports) { | ||
|
||
alert('page login'); | ||
|
||
/***/ }) | ||
/******/ ]); | ||
!(function(e) { | ||
var t = {}; | ||
function n(r) { | ||
if (t[r]) return t[r].exports; | ||
var o = (t[r] = { i: r, l: !1, exports: {} }); | ||
return e[r].call(o.exports, o, o.exports, n), (o.l = !0), o.exports; | ||
} | ||
(n.m = e), | ||
(n.c = t), | ||
(n.d = function(e, t, r) { | ||
n.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }); | ||
}), | ||
(n.r = function(e) { | ||
'undefined' != typeof Symbol && | ||
Symbol.toStringTag && | ||
Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }), | ||
Object.defineProperty(e, '__esModule', { value: !0 }); | ||
}), | ||
(n.t = function(e, t) { | ||
if ((1 & t && (e = n(e)), 8 & t)) return e; | ||
if (4 & t && 'object' == typeof e && e && e.__esModule) return e; | ||
var r = Object.create(null); | ||
if ( | ||
(n.r(r), | ||
Object.defineProperty(r, 'default', { enumerable: !0, value: e }), | ||
2 & t && 'string' != typeof e) | ||
) | ||
for (var o in e) | ||
n.d( | ||
r, | ||
o, | ||
function(t) { | ||
return e[t]; | ||
}.bind(null, o) | ||
); | ||
return r; | ||
}), | ||
(n.n = function(e) { | ||
var t = | ||
e && e.__esModule | ||
? function() { | ||
return e.default; | ||
} | ||
: function() { | ||
return e; | ||
}; | ||
return n.d(t, 'a', t), t; | ||
}), | ||
(n.o = function(e, t) { | ||
return Object.prototype.hasOwnProperty.call(e, t); | ||
}), | ||
(n.p = ''), | ||
n((n.s = 3)); | ||
})([ | ||
, | ||
, | ||
function(e, t) { | ||
alert('page login'); | ||
}, | ||
function(e, t, n) { | ||
e.exports = n(2); | ||
}, | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.