peertube-plugin-livechat/webpack.config.js

60 lines
1.1 KiB
JavaScript
Raw Normal View History

const path = require("path")
const EsmWebpackPlugin = require("@purtuga/esm-webpack-plugin")
2020-08-21 12:47:09 +00:00
const clientFiles = [
2021-04-07 16:14:58 +00:00
'common-client-plugin',
'videowatch-client-plugin'
2020-08-21 12:47:09 +00:00
]
let config = clientFiles.map(f => ({
2021-04-07 16:14:58 +00:00
entry: "./client/" + f + ".ts",
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader'
}
]
},
2021-04-09 11:06:56 +00:00
resolve: {
extensions: [ '.tsx', '.ts', '.js' ],
},
output: {
path: path.resolve(__dirname, "./dist/client"),
2021-04-07 16:14:58 +00:00
filename: "./" + f + ".js",
library: "script",
libraryTarget: "var"
},
2020-08-21 12:47:09 +00:00
plugins: [ new EsmWebpackPlugin() ]
}))
config.push({
entry: "./conversejs/builtin.js",
output: {
path: path.resolve(__dirname, "./dist/client/static"),
filename: "./builtin.js"
}
})
2021-04-09 19:28:16 +00:00
config.push({
entry: "./client/settings.ts",
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader'
}
]
},
resolve: {
extensions: [ '.tsx', '.ts', '.js' ],
},
output: {
path: path.resolve(__dirname, "./dist/client/settings"),
filename: "./settings.js"
}
})
module.exports = config