Skip to content

Commit

Permalink
chore: update example snapshots to match latest webpack5
Browse files Browse the repository at this point in the history
  • Loading branch information
Knagis committed Apr 14, 2023
1 parent 84c8b4f commit 7ebe693
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 37 deletions.
5 changes: 3 additions & 2 deletions examples/custom-template/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ __webpack_require__.r(__webpack_exports__);
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand Down
14 changes: 10 additions & 4 deletions examples/default/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ var options = {};
options.insert = "head";
options.singleton = false;

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* .default */ .Z, options);
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, options);



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* .default.locals */ .Z.locals || {});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"].locals */ .Z.locals || {});

/***/ }),

Expand Down Expand Up @@ -405,8 +405,9 @@ module.exports = function (list, options) {
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand Down Expand Up @@ -463,6 +464,11 @@ module.exports = function (list, options) {
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/nonce */
/******/ (() => {
/******/ __webpack_require__.nc = undefined;
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
Expand Down
5 changes: 3 additions & 2 deletions examples/favicon/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ __webpack_require__.r(__webpack_exports__);
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand Down
5 changes: 3 additions & 2 deletions examples/html-loader/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ __webpack_require__.r(__webpack_exports__);
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand Down
5 changes: 3 additions & 2 deletions examples/inline/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ __webpack_require__.r(__webpack_exports__);
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand Down
5 changes: 3 additions & 2 deletions examples/inline/dist/webpack-5/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand Down
5 changes: 3 additions & 2 deletions examples/javascript-advanced/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extr
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand Down
5 changes: 3 additions & 2 deletions examples/javascript/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ __webpack_require__.r(__webpack_exports__);
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand Down
14 changes: 10 additions & 4 deletions examples/multi-page/dist/webpack-5/first.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ var options = {};
options.insert = "head";
options.singleton = false;

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* .default */ .Z, options);
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, options);



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* .default.locals */ .Z.locals || {});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"].locals */ .Z.locals || {});

/***/ }),

Expand Down Expand Up @@ -405,8 +405,9 @@ module.exports = function (list, options) {
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand Down Expand Up @@ -463,6 +464,11 @@ module.exports = function (list, options) {
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/nonce */
/******/ (() => {
/******/ __webpack_require__.nc = undefined;
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
Expand Down
14 changes: 10 additions & 4 deletions examples/multi-page/dist/webpack-5/second.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ var options = {};
options.insert = "head";
options.singleton = false;

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* .default */ .Z, options);
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Z, options);



/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* .default.locals */ .Z.locals || {});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"].locals */ .Z.locals || {});

/***/ }),

Expand Down Expand Up @@ -405,8 +405,9 @@ module.exports = function (list, options) {
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand Down Expand Up @@ -463,6 +464,11 @@ module.exports = function (list, options) {
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/nonce */
/******/ (() => {
/******/ __webpack_require__.nc = undefined;
/******/ })();
/******/
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
Expand Down
9 changes: 5 additions & 4 deletions examples/pug-loader/dist/webpack-5/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function pug_rethrow(err, filename, lineno, str) {
}
var context, lines, start, end;
try {
str = str || __webpack_require__(993).readFileSync(filename, {encoding: 'utf8'});
str = str || (__webpack_require__(672).readFileSync)(filename, {encoding: 'utf8'});
context = 3;
lines = str.split('\n');
start = Math.max(lineno - context, 0);
Expand Down Expand Up @@ -323,7 +323,7 @@ function pug_rethrow(err, filename, lineno, str) {

/***/ }),

/***/ 993:
/***/ 672:
/***/ (() => {

/* (ignored) */
Expand All @@ -338,8 +338,9 @@ function pug_rethrow(err, filename, lineno, str) {
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand Down
5 changes: 3 additions & 2 deletions examples/sort-manually/dist/webpack-5/a.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ __webpack_require__.r(__webpack_exports__);
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(__webpack_module_cache__[moduleId]) {
/******/ return __webpack_module_cache__[moduleId].exports;
/******/ var cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = __webpack_module_cache__[moduleId] = {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"semistandard": "^13.0.1",
"standard-version": "^9.3.0",
"style-loader": "2.0.0",
"typescript": "4.1.3",
"webpack": "5.24.3",
"typescript": "4.9.4",
"webpack": "^5.79.0",
"webpack-cli": "4.5.0",
"webpack-recompilation-simulator": "3.2.0"
},
Expand Down
14 changes: 12 additions & 2 deletions spec/example.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ const webpackMajorVersion = require('webpack/package.json').version.split('.')[0

const OUTPUT_DIR = path.resolve(__dirname, '../dist');

/** set to `true` in order to update example snapshots */
const UPDATE_SNAPSHOTS = false;

jest.setTimeout(30000);

function runExample (exampleName, done) {
Expand Down Expand Up @@ -50,10 +53,17 @@ function runExample (exampleName, done) {
res.diffSet.filter(diff => diff.state === 'distinct').forEach(diff => {
const file1Contents = fs.readFileSync(path.join(diff.path1, diff.name1)).toString();
const file2Contents = fs.readFileSync(path.join(diff.path2, diff.name2)).toString();
expect(file1Contents).toEqual(file2Contents);

if (UPDATE_SNAPSHOTS) {
fs.writeFileSync(path.join(diff.path1, diff.name1), file2Contents);
} else {
expect(file1Contents).toEqual(file2Contents);
}
});

expect(res.same).toBe(true);
if (!UPDATE_SNAPSHOTS) {
expect(res.same).toBe(true);
}
rimraf(exampleOutput, done);
} catch (e) {
done(e);
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
"resolveJsonModule": true,
"skipLibCheck": true
"skipLibCheck": true,
"useUnknownInCatchVariables": false
},
"types": ["node"],
"exclude": [
Expand Down

0 comments on commit 7ebe693

Please sign in to comment.