Skip to content

Commit 7c1d677

Browse files
committed
chore: add plugin-compat plugin
1 parent 30a96f1 commit 7c1d677

File tree

7 files changed

+99
-0
lines changed

7 files changed

+99
-0
lines changed

examples/plugin-compat/index.html

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "example-loader-compat",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"dev": "rspack serve",
8+
"build": "rspack build"
9+
},
10+
"keywords": [],
11+
"author": "",
12+
"license": "ISC",
13+
"devDependencies": {
14+
"@rspack/cli": "workspace:*",
15+
"webpack-bundle-analyzer": "4.7.0",
16+
"copy-webpack-plugin": "5.1.2",
17+
"@rspack/plugin-html": "workspace:*",
18+
"webpack-stats-plugin": "1.1.1"
19+
}
20+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
www.google.com
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
2+
const CopyPlugin = require('copy-webpack-plugin');
3+
const HtmlPlugin = require('@rspack/plugin-html').default;
4+
const { StatsWriterPlugin } = require('webpack-stats-plugin');
5+
/**
6+
* @type {import('@rspack/cli').Configuration}
7+
*/
8+
module.exports = {
9+
target: 'node',
10+
mode: 'development',
11+
stats: {all:true},
12+
entry: {
13+
main: './src/index.js'
14+
},
15+
builtins: {
16+
minify: false
17+
},
18+
plugins: [
19+
new BundleAnalyzerPlugin({
20+
openAnalyzer:false,
21+
analyzerMode:'json'
22+
}),
23+
new CopyPlugin([
24+
{
25+
from: 'public',
26+
dist: '.'
27+
}
28+
]),
29+
new HtmlPlugin({
30+
template: './index.html'
31+
}),
32+
new StatsWriterPlugin({
33+
stats: {all:true},
34+
filename: 'stats.json'
35+
})
36+
]
37+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const answer = 42;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { answer } from './answer';
2+
3+
console.log({answer});

pnpm-lock.yaml

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)