Skip to content

Commit 39c38a4

Browse files
jantimonPutzi Sanfivethreeo
committed
feat: Add webpack 5 support
Co-authored-by: Putzi San <putzisan@putzisan.de> Co-authored-by: Øyvind Saltvik <oyvind.saltvik@gmail.com>
1 parent c5a5882 commit 39c38a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+3334
-452
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@ node_js:
33
- stable
44
- lts/*
55
- 6.9
6+
env:
7+
- WEBPACK_CORE=4
8+
- WEBPACK_CORE=beta
9+
jobs:
10+
exclude:
11+
- node_js: 6.9
12+
env: WEBPACK_CORE=beta
613
before_install:
714
- stty columns 120
815
install:
916
- travis_retry npm install --ignore-scripts
17+
- travis_retry npm install "webpack@$WEBPACK_CORE" --ignore-scripts
1018
script:
1119
- travis_retry npm test
Loading
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/******/ (() => { // webpackBootstrap
2+
/******/ var __webpack_modules__ = ({
3+
4+
/***/ 636:
5+
/***/ (() => {
6+
7+
// extracted by mini-css-extract-plugin
8+
9+
/***/ })
10+
11+
/******/ });
12+
/************************************************************************/
13+
/******/ // The module cache
14+
/******/ var __webpack_module_cache__ = {};
15+
/******/
16+
/******/ // The require function
17+
/******/ function __webpack_require__(moduleId) {
18+
/******/ // Check if module is in cache
19+
/******/ if(__webpack_module_cache__[moduleId]) {
20+
/******/ return __webpack_module_cache__[moduleId].exports;
21+
/******/ }
22+
/******/ // Create a new module (and put it into the cache)
23+
/******/ var module = __webpack_module_cache__[moduleId] = {
24+
/******/ // no module.id needed
25+
/******/ // no module.loaded needed
26+
/******/ exports: {}
27+
/******/ };
28+
/******/
29+
/******/ // Execute the module function
30+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
31+
/******/
32+
/******/ // Return the exports of the module
33+
/******/ return module.exports;
34+
/******/ }
35+
/******/
36+
/************************************************************************/
37+
/******/ /************************************************************************/
38+
(() => {
39+
__webpack_require__(636);
40+
var h1 = document.createElement('h1');
41+
h1.innerHTML = 'Hello world!';
42+
document.body.appendChild(h1);
43+
44+
})();
45+
46+
/******/ })()
47+
;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!doctype html><html lang="en" manifest="manifest.appcache"><head><meta charset="utf-8"><title>Example template</title><meta name="viewport" content="width=device-width,initial-scale=1"><link href="styles.css" rel="stylesheet"></head><body><img src="0714810ae3fb211173e2964249507195.png"><script src="bundle.js"></script></body></html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CACHE MANIFEST
2+
# f509954c60c2fd048c91
3+
4+
0714810ae3fb211173e2964249507195.png
5+
styles.css
6+
bundle.js
7+
8+
NETWORK:
9+
*
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background: snow;
3+
}

examples/appcache/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
rules: [
1717
{ test: /\.css$/, use: [MiniCssExtractPlugin.loader, 'css-loader'] },
1818
{ test: /\.png$/, loader: 'file-loader' },
19-
{ test: /\.html$/, loader: 'html-loader?-removeOptionalTags' }
19+
{ test: /\.html$/, loader: 'html-loader', options: { removeOptionalTags: false } }
2020
]
2121
},
2222
plugins: [

examples/build-examples.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ examples.forEach(function (exampleName) {
2020
var configFile = path.join(examplePath, 'webpack.config.js');
2121

2222
var config = require(configFile);
23-
if (webpackMajorVersion === '4') {
23+
if (Number(webpackMajorVersion) >= 4) {
2424
config.plugins.unshift(new webpack.LoaderOptionsPlugin({
2525
options: {
2626
context: process.cwd() // or the same value as `context`
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[73],{
2+
3+
/***/ 173:
4+
/***/ ((module, exports, __webpack_require__) => {
5+
6+
exports = module.exports = __webpack_require__(609)(false);
7+
// Module
8+
exports.push([module.id, "body {\n background: snow;\n}", ""]);
9+
10+
11+
12+
/***/ }),
13+
14+
/***/ 73:
15+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
16+
17+
18+
var content = __webpack_require__(173);
19+
20+
if(typeof content === 'string') content = [[module.id, content, '']];
21+
22+
var transform;
23+
var insertInto;
24+
25+
26+
27+
var options = {"hmr":true}
28+
29+
options.transform = transform
30+
options.insertInto = undefined;
31+
32+
var update = __webpack_require__(379)(content, options);
33+
34+
if(content.locals) module.exports = content.locals;
35+
36+
if(false) {}
37+
38+
/***/ })
39+
40+
}]);

0 commit comments

Comments
 (0)