mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 23:30:00 -04:00
setup rspack
Co-authored-by: Percs <Percslol@users.noreply.github.com>
This commit is contained in:
parent
b448c5505b
commit
146c202ae2
5 changed files with 2847 additions and 144 deletions
49
rspack.config.js
Normal file
49
rspack.config.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
import { defineConfig } from "@rspack/cli";
|
||||
// import { RsdoctorRspackPlugin } from "@rsdoctor/rspack-plugin";
|
||||
import { join } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const __dirname = fileURLToPath(new URL(".", import.meta.url));
|
||||
|
||||
export default defineConfig({
|
||||
entry: {
|
||||
shared: join(__dirname, "src/shared/index.ts"),
|
||||
worker: join(__dirname, "src/worker/index.ts"),
|
||||
client: join(__dirname, "src/client/index.ts"),
|
||||
config: join(__dirname, "src/scramjet.config.ts"),
|
||||
codecs: join(__dirname, "src/codecs/index.ts"),
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".ts", ".js"],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: "builtin:swc-loader",
|
||||
exclude: ["/node_modules/"],
|
||||
options: {
|
||||
jsc: {
|
||||
parser: {
|
||||
syntax: "typescript"
|
||||
}
|
||||
}
|
||||
},
|
||||
type: "javascript/auto"
|
||||
}
|
||||
]
|
||||
},
|
||||
output: {
|
||||
filename: "scramjet.[name].js",
|
||||
path: join(__dirname, "dist")
|
||||
},
|
||||
plugins: [
|
||||
// new RsdoctorRspackPlugin({
|
||||
// supports: {
|
||||
// parseBundle: true,
|
||||
// banner: true
|
||||
// }
|
||||
// })
|
||||
],
|
||||
watch: true
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue