Update to webpack 5

master
Chocobozzz 3 years ago
parent d1d1293b3d
commit 0595929613
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
  1. 2
      client/common-client-plugin.js
  2. 5060
      package-lock.json
  3. 5
      package.json
  4. 15
      webpack.config.js

@ -1,5 +1,5 @@
function register ({ registerHook, peertubeHelpers }) { function register ({ registerHook, peertubeHelpers }) {
console.log('Hello world')
} }
export { export {

5060
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -16,9 +16,8 @@
"assets/style.css" "assets/style.css"
], ],
"devDependencies": { "devDependencies": {
"@purtuga/esm-webpack-plugin": "^1.1.1", "webpack": "^5.50.0",
"webpack": "^4.41.2", "webpack-cli": "^4.7.2"
"webpack-cli": "^3.3.10"
}, },
"engine": { "engine": {
"peertube": ">=1.3.0" "peertube": ">=1.3.0"

@ -1,20 +1,23 @@
const path = require("path") const path = require("path")
const EsmWebpackPlugin = require("@purtuga/esm-webpack-plugin")
const clientFiles = [ const clientFiles = [
'common-client-plugin.js' 'common-client-plugin.js'
] ]
let config = clientFiles.map(f => ({ let config = clientFiles.map(f => ({
entry: "./client/" + f, entry: "./client/" + f,
experiments: {
outputModule: true
},
output: { output: {
path: path.resolve(__dirname, "./dist"), path: path.resolve(__dirname, "./dist"),
filename: "./" + f, filename: "./" + f,
library: "script", library: {
libraryTarget: "var" type: "module"
}, }
plugins: [ new EsmWebpackPlugin() ] }
})) }))
module.exports = config module.exports = config

Loading…
Cancel
Save