(webpack) adding webpack for dependencies bundling, .gitignore and .npmignore

This commit is contained in:
Rigel Kent 2019-11-19 17:08:04 +01:00 committed by Chocobozzz
parent 664761b26c
commit e5fda80e7b
5 changed files with 4089 additions and 13 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
node_modules
.cache
dist

1
.npmignore Normal file
View File

@ -0,0 +1 @@
LICENSE

4049
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,30 +1,37 @@
{
"name": "peertube-plugin-quickstart",
"version": "0.0.2",
"description": "PeerTube plugin quickstart",
"version": "0.0.2",
"author": "Chocobozzz",
"bugs": "https://framagit.org/framasoft/peertube/peertube-plugin-quickstart/issues",
"clientScripts": [
{
"script": "dist/common-client-plugin.js",
"scopes": [
"common"
]
}
],
"css": [
"assets/style.css"
],
"devDependencies": {
"@purtuga/esm-webpack-plugin": "^1.1.1",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
},
"engine": {
"peertube": ">=1.3.0"
},
"homepage": "https://framagit.org/framasoft/peertube/peertube-plugin-quickstart",
"keywords": [
"peertube",
"plugin"
],
"homepage": "https://framagit.org/framasoft/peertube/peertube-plugin-quickstart",
"author": "Chocobozzz",
"bugs": "https://framagit.org/framasoft/peertube/peertube-plugin-quickstart/issues",
"library": "./main.js",
"staticDirs": {
"images": "public/images"
},
"css": [
"assets/style.css"
],
"clientScripts": [
{
"script": "client/common-client-plugin.js",
"scopes": [ "common" ]
}
],
"translations": {
"fr-FR": "./languages/fr.json"
}

16
webpack.config.js Normal file
View File

@ -0,0 +1,16 @@
const path = require("path")
const EsmWebpackPlugin = require("@purtuga/esm-webpack-plugin")
let config = {
entry: "./client/common-client-plugin.js",
output: {
path: path.resolve(__dirname, "./dist"),
filename: "./common-client-plugin.js",
library: "script",
libraryTarget: "var"
},
plugins: [new EsmWebpackPlugin()]
}
module.exports = config