This repository has been archived by the owner on Jul 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
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 #110 from WordPress/build-test-script-with-webpack
Build the stress testing script with webpack instead of esbuild
- Loading branch information
Showing
3 changed files
with
86 additions
and
230 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,54 +1,95 @@ | ||
const { resolve } = require('path'); | ||
|
||
module.exports = { | ||
entry: { | ||
runtime: './src/runtime', | ||
}, | ||
output: { | ||
filename: '[name].js', | ||
path: resolve(process.cwd(), 'build'), | ||
}, | ||
optimization: { | ||
runtimeChunk: { | ||
name: 'vendors', | ||
module.exports = [ | ||
{ | ||
entry: { | ||
runtime: './src/runtime', | ||
}, | ||
splitChunks: { | ||
cacheGroups: { | ||
vendors: { | ||
test: /[\\/]node_modules[\\/]/, | ||
name: 'vendors', | ||
minSize: 0, | ||
chunks: 'all', | ||
output: { | ||
filename: '[name].js', | ||
path: resolve(process.cwd(), 'build'), | ||
}, | ||
optimization: { | ||
runtimeChunk: { | ||
name: 'vendors', | ||
}, | ||
splitChunks: { | ||
cacheGroups: { | ||
vendors: { | ||
test: /[\\/]node_modules[\\/]/, | ||
name: 'vendors', | ||
minSize: 0, | ||
chunks: 'all', | ||
}, | ||
}, | ||
}, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(j|t)sx?$/, | ||
exclude: /node_modules/, | ||
use: [ | ||
{ | ||
loader: require.resolve('babel-loader'), | ||
options: { | ||
cacheDirectory: | ||
process.env.BABEL_CACHE_DIRECTORY || true, | ||
babelrc: false, | ||
configFile: false, | ||
presets: [ | ||
[ | ||
'@babel/preset-react', | ||
{ | ||
runtime: 'automatic', | ||
importSource: 'preact', | ||
}, | ||
], | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(j|t)sx?$/, | ||
exclude: /node_modules/, | ||
use: [ | ||
{ | ||
loader: require.resolve('babel-loader'), | ||
options: { | ||
cacheDirectory: | ||
process.env.BABEL_CACHE_DIRECTORY || true, | ||
babelrc: false, | ||
configFile: false, | ||
presets: [ | ||
[ | ||
'@babel/preset-react', | ||
{ | ||
runtime: 'automatic', | ||
importSource: 'preact', | ||
}, | ||
{ | ||
entry: { | ||
hydrationScriptForTesting: './benchmark/hydrationScript.js', | ||
}, | ||
output: { | ||
filename: '[name].js', | ||
path: resolve(process.cwd(), 'build'), | ||
}, | ||
devtool: 'inline-source-map', | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(j|t)sx?$/, | ||
exclude: /node_modules/, | ||
use: [ | ||
{ | ||
loader: require.resolve('babel-loader'), | ||
options: { | ||
cacheDirectory: | ||
process.env.BABEL_CACHE_DIRECTORY || true, | ||
babelrc: false, | ||
configFile: false, | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
esmodules: true, | ||
}, | ||
}, | ||
], | ||
], | ||
], | ||
}, | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
}; | ||
]; |