Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
feat: add terser-webpack-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
hardfist committed Jul 1, 2024
1 parent 79d67db commit 9c56ecf
Show file tree
Hide file tree
Showing 4 changed files with 321 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/terser-webpack-plugin@5/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@rspack-compat/terser-webpack-plugin_5",
"scripts": {
"build": "rspack build"
},
"devDependencies": {
"@rspack/cli": "1.0.0-alpha.0",
"@rspack/core": "1.0.0-alpha.0",
"terser-webpack-plugin": "5.3.10"
},
"rspack": {
"version": "1.0.0-alpha.0"
}
}
15 changes: 15 additions & 0 deletions packages/terser-webpack-plugin@5/rspack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { defineConfig } = require('@rspack/cli')
const tererPlugin = require('terser-webpack-plugin');
const { StatsWriterPlugin } = require('webpack-stats-plugin');
const rspack = require('@rspack/core');
module.exports = defineConfig({
plugins: [
new StatsWriterPlugin()
],
optimization: {
minimizer: [
new tererPlugin(),
new rspack.SwcCssMinimizerRspackPlugin()
]
}
});;
3 changes: 3 additions & 0 deletions packages/terser-webpack-plugin@5/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function main() {
return 'hello world'
}
Loading

0 comments on commit 9c56ecf

Please sign in to comment.