build(frontend): use esbuild instead of (to be deleted) webpack for bundling static files
This commit is contained in:
parent
6c862c98e9
commit
cb9ce5b196
36
esbuild.config.mjs
Normal file
36
esbuild.config.mjs
Normal file
@ -0,0 +1,36 @@
|
||||
import * as esbuild from 'esbuild';
|
||||
|
||||
import { sassPlugin } from 'esbuild-sass-plugin';
|
||||
import svgPlugin from 'esbuild-plugin-svg-bundle';
|
||||
import { copy } from 'esbuild-plugin-copy';
|
||||
|
||||
await esbuild.build({
|
||||
plugins: [
|
||||
sassPlugin(),
|
||||
svgPlugin({
|
||||
bundleFile: './svg-bundle.svg',
|
||||
bundleUrl: './svg-bundle.svg',
|
||||
}),
|
||||
copy({
|
||||
resolveFrom: 'cwd',
|
||||
assets: {
|
||||
from: [ './assets/favicons/*' ],
|
||||
to: [ './static' ],
|
||||
},
|
||||
}),
|
||||
copy({
|
||||
resolveFrom: 'cwd',
|
||||
assets: {
|
||||
from: [ './config/robots.txt' ],
|
||||
to: [ './static' ],
|
||||
},
|
||||
}),
|
||||
],
|
||||
entryPoints: [
|
||||
'./frontend/src/main.js',
|
||||
'./frontend/src/polyfill.js',
|
||||
],
|
||||
bundle: true,
|
||||
minify: true,
|
||||
outdir: './static',
|
||||
});
|
||||
1270
package-lock.json
generated
1270
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -30,6 +30,10 @@
|
||||
"copy-webpack-plugin": "^12.0.2",
|
||||
"css-loader": "^7.1.2",
|
||||
"css-minimizer-webpack-plugin": "^7.0.0",
|
||||
"esbuild": "0.24.0",
|
||||
"esbuild-plugin-copy": "2.1.1",
|
||||
"esbuild-plugin-svg-bundle": "1.3.0",
|
||||
"esbuild-sass-plugin": "3.3.1",
|
||||
"eslint": "^9.9.1",
|
||||
"file-loader": "^6.2.0",
|
||||
"fs-extra": "^11.2.0",
|
||||
@ -74,5 +78,8 @@
|
||||
"sodium-javascript": "^0.8.0",
|
||||
"toposort": "^2.0.2",
|
||||
"whatwg-fetch": "^3.6.20"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node esbuild.config.mjs"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user