test: added

This commit is contained in:
alexander.akait 2024-11-12 19:55:42 +03:00
parent 0ab5b9e00c
commit 9a56300bae
7 changed files with 120 additions and 0 deletions

View File

@ -0,0 +1,7 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn special-lint-fix` to update
*/
declare const check: (options: import("../../../declarations/plugins/optimize/MergeDuplicateChunksPlugin").MergeDuplicateChunksPluginOptions) => boolean;
export = check;

View File

@ -0,0 +1,6 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn special-lint-fix` to update
*/
"use strict";function r(t,{instancePath:e="",parentData:a,parentDataProperty:o,rootData:s=t}={}){if(!t||"object"!=typeof t||Array.isArray(t))return r.errors=[{params:{type:"object"}}],!1;{const e=0;for(const e in t)if("stage"!==e)return r.errors=[{params:{additionalProperty:e}}],!1;if(0===e&&void 0!==t.stage&&"number"!=typeof t.stage)return r.errors=[{params:{type:"number"}}],!1}return r.errors=null,!0}module.exports=r,module.exports.default=r;

View File

@ -1038,6 +1038,29 @@ It's not allowed to load an initial chunk on demand. The chunk name \\"entry3\\"
webpack x.x.x compiled with 2 errors in X ms"
`;
exports[`StatsTestCases should print correct stats for dynamic-import 1`] = `
"asset common.js 1.13 MiB [emitted] (name: common) (id hint: vendors)
asset runtime.js X KiB [emitted] (name: runtime)
asset pages/home.js X KiB [emitted] (name: pages/home)
asset main.js X KiB [emitted] (name: main)
Entrypoint main 1.14 MiB = runtime.js X KiB common.js 1.13 MiB main.js X KiB
runtime modules X KiB 12 modules
built modules 1.14 MiB [built]
modules by path ../../../node_modules/ 1.13 MiB
modules by path ../../../node_modules/react/ X KiB 4 modules
modules by path ../../../node_modules/react-dom/ X KiB
../../../node_modules/react-dom/client.js X bytes [built] [code generated]
+ 2 modules
modules by path ../../../node_modules/scheduler/ X KiB
../../../node_modules/scheduler/index.js X bytes [built] [code generated]
../../../node_modules/scheduler/cjs/scheduler.development.js X KiB [built] [code generated]
modules by path ./src/ X KiB
./src/index.js X bytes [built] [code generated]
./src/pages/ lazy ^\\\\.\\\\/.*$ chunkName: pages/[request] namespace object X bytes [built] [code generated]
./src/pages/home.js X KiB [optional] [built] [code generated]
webpack x.x.x compiled successfully in X ms"
`;
exports[`StatsTestCases should print correct stats for entry-filename 1`] = `
"PublicPath: auto
asset a.js X KiB [emitted] (name: a)

View File

@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-react', { runtime: 'automatic' }],
],
sourceType: 'unambiguous'
};

View File

@ -0,0 +1,25 @@
import React from 'react'
import { createRoot } from 'react-dom/client'
const Loading = () => 'Loading...'
class AsyncComponent extends React.Component {
state = { Component: Loading }
constructor(props) {
super(props)
import(/* webpackChunkName: 'pages/[request]' */ `./pages/${props.page}`)
.then(({ default: Component }) => this.setState({ Component }))
}
render() {
const { state: { Component } } = this
return <Component />
}
}
const App = () => <AsyncComponent page='home' />
const root = createRoot(document.getElementById('app'))
root.render(<App />)

View File

@ -0,0 +1,29 @@
const paths = [
'1111 1111111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 11 111 11 111 11 111 11 111 11 11111 111111 111 11 111 11 111 111 11 111 11 111 11 111 111 111 111 111 111 1111 111 1111 111 1111 111 111 111 111 111 111 111 1111 111 111 111 111 111 111 111 111 1111',
'1111 1111111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 11111 111111 111 11 111 11 111 111 11 111 11 111 11 111 111 111 111 111 111 1111 111 1111 111 1111 111 111 111 111 111 111 111 1111 111 111 111 111 111 111 111 111 1111',
'1111 1111111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 11 111 11 111 11 111 1 11111 11111 11111 11111 11111 11111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 1111',
'1111 1111111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 11 111 11 111 11 111 11 111 11 111 11 111 11 11111 11111 11111 11111 11111 11111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 1111',
'1111 1111111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 11 111 1 11111 11111 11111 11111 11111 11111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 111 1111',
'1111 11111111 1111 111111111111 11111111111 11 111 111 111 111 111 111111 111 11 111 11 11 11 1111 1111 1111 1111 11 1 1111 1111 11 1 11 11 11 1 1111 11 1 11 11 11 11 111 1 11111 1111111111111111111111 11 11 11 11 11 11 1 11 1111 1111 11111 111111 1111 11 1111 11111 11111 11111 11 1 11 1 11 11 11111111111111111111111111 11111 11111111111111111 1111 1111 11111 11111 11111 11111 11111 11111 11 1 11 11 1 111 1 11111 11111 1111 1111 11 11 11 11 11 1 11 11 111 1 11 1 11111 1111 1111111111 1 11 11 11 11 11 1 11 111 11111 11111 11111 11 1111 11111 11111 11111 11 1 11 11 11 1 11111111111111111111111111111 1111 111111 11111111111111 1111 11111111 111 111 111 111 1111',
'1111 11111111 1111 111111111111 11111111111 111 111 111 111 111 111 111111 111 11 111 11 11 11 11111 11111 11111 11111 11 1 1111 1111 11 1 11 11 11 11 1111 11 1 11 11 11 11 11111 11111 1111111111111111111111 11 11 11 11 11 11 1 11 1111 1111 11111 111111 1111 11 1111 11111 11111 11111 11 1 11 1 11 11 111111111111111111 1111111 1111 11111111111111111 111111111 11111 11111 11111 11111 11111 11111 11 1 11 11111 111111 11111 11111 1111 11 1 11 11 11 11 11 1 11 11 111 11 11 11 11111 1111 1111111111 1 11 11 11 11 11 1 11 111 11111 11111 11111 11 1111 11111 11111 11111 11 1 11 11 11 1 1111111111111111111111111111111111111111111111111111111111 1111111111111 111 111 111 111 1111',
'1111 11111 1111111111111111 1111 11111 111111 111 1 11 1 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 1 11 1 1111 1111 11111 1111 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 1111 11111 111 1 11 1 11111 11111 11 11 11 11 11111 111111 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 1111 11 11 11 1 11 1 11 1 1111 11 1 11 1111 11 11111 11111 11111111111 1111 11111 11 11111 111111111111111111111111111v111h111V1111111 11111 11111 11111 11111 11111 11 1 11 1 11111 1111 11 11 11 11 11 1 111 1 111 11 11 11 11 11111 11 1111 11111 1111111111 1111 11111 11 11111 1111111111111111 1111 1111V1111',
'1111 11111 1111111111111111 1111 11111 11111 111111 11111 1111 111 11 1 1 1 1111 1111 11 11 11 11 1111 111',
]
const Home = () => <h1>Home</h1>
export default Home

View File

@ -0,0 +1,24 @@
/** @type {import("../../../").Configuration} */
module.exports = {
devtool: false,
mode: "development",
module: {
rules: [
{
exclude: /node_modules/,
test: /\.[cm]?js$/,
use: {
loader: "babel-loader",
options: {
presets: [["@babel/preset-react", { runtime: "automatic" }]],
sourceType: "unambiguous"
}
}
}
]
},
optimization: {
runtimeChunk: "single",
splitChunks: { chunks: "all", name: "common" }
}
};