Skip to content

Commit 109ab9e

Browse files
committed
add webpack
1 parent 6afc820 commit 109ab9e

File tree

3 files changed

+853
-0
lines changed

3 files changed

+853
-0
lines changed

scenarios/browser/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "scenarios-browser",
3+
"main": "webpack.js",
4+
"private": true,
5+
"version": "0.0.0",
6+
"devDependencies": {
7+
"html-webpack-plugin": "^5.5.0",
8+
"webpack": "^5.62.1",
9+
"webpack-bundle-analyzer": "^4.5.0"
10+
}
11+
}

scenarios/browser/webpack.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
const path = require('path');
2+
3+
const webpack = require('webpack');
4+
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
5+
const HtmlWebpackPlugin = require('html-webpack-plugin');
6+
7+
webpack(
8+
{
9+
mode: 'development',
10+
entry: path.resolve(__dirname, 'perf-auto'),
11+
output: {
12+
filename: 'main.js',
13+
path: path.resolve(__dirname, 'dist', 'perf-auto'),
14+
},
15+
plugins: [new BundleAnalyzerPlugin({ analyzerMode: 'static' }), new HtmlWebpackPlugin()],
16+
},
17+
(err, stats) => {
18+
if (err || stats.hasErrors()) {
19+
// eslint-disable-next-line no-console
20+
console.log(err);
21+
}
22+
// eslint-disable-next-line no-console
23+
console.log('DONE', stats);
24+
},
25+
);

0 commit comments

Comments
 (0)