Move to esbuild

master
Chocobozzz 3 years ago
parent 65bf82a2be
commit 6b92524ab9
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
  1. 2655
      package-lock.json
  2. 9
      package.json
  3. 20
      scripts/build.js
  4. 23
      webpack.config.js

2655
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -15,10 +15,6 @@
"css": [
"assets/style.css"
],
"devDependencies": {
"webpack": "^5.50.0",
"webpack-cli": "^4.7.2"
},
"engine": {
"peertube": ">=1.3.0"
},
@ -30,12 +26,15 @@
"library": "./main.js",
"scripts": {
"prepare": "npm run build",
"build": "webpack --mode=production"
"build": "node ./scripts/build.js"
},
"staticDirs": {
"images": "public/images"
},
"translations": {
"fr-FR": "./languages/fr.json"
},
"devDependencies": {
"esbuild": "^0.14.36"
}
}

@ -0,0 +1,20 @@
const path = require('path')
const esbuild = require('esbuild')
const clientFiles = [
'common-client-plugin.js'
]
const configs = clientFiles.map(f => ({
entryPoints: [ path.resolve(__dirname, '..', 'client', f) ],
bundle: true,
minify: true,
format: 'esm',
target: 'safari11',
outfile: path.resolve(__dirname, '..', 'dist', f),
}))
const promises = configs.map(c => esbuild.build(c))
Promise.all(promises)
.catch(() => process.exit(1))

@ -1,23 +0,0 @@
const path = require("path")
const clientFiles = [
'common-client-plugin.js'
]
let config = clientFiles.map(f => ({
entry: "./client/" + f,
experiments: {
outputModule: true
},
output: {
path: path.resolve(__dirname, "./dist"),
filename: "./" + f,
library: {
type: "module"
}
}
}))
module.exports = config
Loading…
Cancel
Save