Separing frontend and backend code in different folders.
This commit is contained in:
parent
8f79f813c7
commit
dca4e67b35
20
package.json
20
package.json
@ -6,13 +6,13 @@
|
|||||||
"bugs": "https://github.com/JohnXLivingston/peertube-plugin-livechat/issues",
|
"bugs": "https://github.com/JohnXLivingston/peertube-plugin-livechat/issues",
|
||||||
"clientScripts": [
|
"clientScripts": [
|
||||||
{
|
{
|
||||||
"script": "dist/videowatch-client-plugin.js",
|
"script": "dist/client/videowatch-client-plugin.js",
|
||||||
"scopes": [
|
"scopes": [
|
||||||
"video-watch"
|
"video-watch"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"script": "dist/common-client-plugin.js",
|
"script": "dist/client/common-client-plugin.js",
|
||||||
"scopes": [
|
"scopes": [
|
||||||
"common"
|
"common"
|
||||||
]
|
]
|
||||||
@ -43,20 +43,22 @@
|
|||||||
"peertube",
|
"peertube",
|
||||||
"plugin"
|
"plugin"
|
||||||
],
|
],
|
||||||
"library": "./main.js",
|
"library": "./dist/server/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rm -rf dist/*",
|
"clean": "rm -rf dist/*",
|
||||||
"prepare": "npm run build",
|
"prepare": "npm run build",
|
||||||
"build:converse": "mkdir -p dist/conversejs && cp -r node_modules/converse.js/dist/* dist/conversejs/",
|
"build:converse": "mkdir -p dist/client/conversejs && cp -r node_modules/converse.js/dist/* dist/client/conversejs/",
|
||||||
"build:images": "mkdir -p dist/images && npx svgo -f public/images/ -o dist/images/",
|
"build:images": "mkdir -p dist/client/images && npx svgo -f public/images/ -o dist/client/images/",
|
||||||
"build:webpack": "webpack --mode=production",
|
"build:webpack": "webpack --mode=production",
|
||||||
"build": "npm-run-all -s clean -p build:converse build:images build:webpack",
|
"build:server": "mkdir -p dist/server && cp ./server/main.js dist/server/",
|
||||||
|
"build:serverconverse": "mkdir -p dist/server/conversejs && cp conversejs/index.html dist/server/conversejs/",
|
||||||
|
"build": "npm-run-all -s clean -p build:converse build:images build:webpack build:server build:serverconverse",
|
||||||
"lint": "npx eslint --ext .js ."
|
"lint": "npx eslint --ext .js ."
|
||||||
},
|
},
|
||||||
"staticDirs": {
|
"staticDirs": {
|
||||||
"static": "dist/static",
|
"static": "dist/client/static",
|
||||||
"conversejs": "dist/conversejs/",
|
"conversejs": "dist/client/conversejs/",
|
||||||
"images": "dist/images/"
|
"images": "dist/client/images/"
|
||||||
},
|
},
|
||||||
"translations": {
|
"translations": {
|
||||||
"fr-FR": "./languages/fr.json"
|
"fr-FR": "./languages/fr.json"
|
||||||
|
@ -10,7 +10,7 @@ const clientFiles = [
|
|||||||
let config = clientFiles.map(f => ({
|
let config = clientFiles.map(f => ({
|
||||||
entry: "./client/" + f,
|
entry: "./client/" + f,
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, "./dist"),
|
path: path.resolve(__dirname, "./dist/client"),
|
||||||
filename: "./" + f,
|
filename: "./" + f,
|
||||||
library: "script",
|
library: "script",
|
||||||
libraryTarget: "var"
|
libraryTarget: "var"
|
||||||
@ -21,7 +21,7 @@ let config = clientFiles.map(f => ({
|
|||||||
config.push({
|
config.push({
|
||||||
entry: "./conversejs/builtin.js",
|
entry: "./conversejs/builtin.js",
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, "./dist/static"),
|
path: path.resolve(__dirname, "./dist/client/static"),
|
||||||
filename: "./builtin.js"
|
filename: "./builtin.js"
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user