feature: chained html and pug loader to support parameter injection

This commit is contained in:
plup 2019-11-03 18:28:36 +01:00
parent 3a321c2b00
commit 3cb7dbeeb1
4 changed files with 7602 additions and 10 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/src/config.json
*.iml
*.swp
dist

7570
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -9,16 +9,17 @@
"dependencies": {
"@babel/core": "^7.6.4",
"babel-loader": "^8.0.6",
"css-loader": "^3.2.0",
"file-loader": "^4.2.0",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.8.0",
"node-sass": "^4.13.0",
"pug": "^2.0.4",
"pug-html-loader": "^1.1.5",
"sass-loader": "^8.0.0",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.9.0",
"html-webpack-plugin": "^3.2.0",
"pug": "^2.0.4",
"pug-loader": "^2.4.0",
"css-loader": "^3.2.0",
"node-sass": "^4.13.0",
"sass-loader": "^8.0.0",
"mini-css-extract-plugin": "^0.8.0",
"file-loader": "^4.2.0"
"webpack-dev-server": "^3.9.0"
}
}

View File

@ -22,7 +22,27 @@ const config = {
rules: [
{
test: /\.pug$/,
use: "pug-loader"
use: [
{ loader: "html-loader" },
{ loader: "pug-html-loader",
options: {
data: {
cdn: "https://cdn.happy-dev.fr",
xmpp: "https://jabber.happy-dev.fr/http-bind/",
authority: "http://127.0.0.1:8000/openid/",
endpoints: {
businessproviders: "http://127.0.0.1:8000/businessproviders/",
circles: "http://127.0.0.1:8000/circles/",
groups: "http://127.0.0.1:8000/groups/",
joboffers: "http://127.0.0.1:8000/job-offers/",
projects: "http://127.0.0.1:8000/projects/",
skills: "http://127.0.0.1:8000/skills/",
users: "http://127.0.0.1:8000/users/"
}
}
}
}
]
},
{
test: /\.js$/,