Skip to content
This repository was archived by the owner on Oct 13, 2024. It is now read-only.

Commit 24dc315

Browse files
fix(build): use webapp for npm dependencies
1 parent 049acf3 commit 24dc315

File tree

6 files changed

+50
-19
lines changed

6 files changed

+50
-19
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
working-directory: Themerr-plex.bundle
9191
run: |
9292
npm install
93-
mv ./node_modules ./Contents/Resources/web
93+
npm run build
9494
9595
- name: Build plist
9696
shell: bash

Contents/Resources/web/templates/base.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@
1212
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
1313

1414
<!-- Bootstrap CSS -->
15-
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='node_modules/bootstrap/dist/css/bootstrap.min.css') }}">
15+
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='dist/css/bootstrap.bundle.css') }}">
1616

1717
<!-- Fonts -->
18-
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='node_modules/@fortawesome/fontawesome-free/css/all.min.css') }}">
19-
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='node_modules/@fontsource/open-sans/index.css') }}">
18+
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='dist/css/fontawesome.bundle.css') }}">
19+
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='dist/css/open-sans.bundle.css') }}">
2020

2121
<!-- CSS -->
2222
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/custom.css') }}">
2323

2424
<!-- Bootstrap Optional JavaScript -->
25-
<script type="text/javascript" src="{{ url_for('static', filename='node_modules/bootstrap/dist/js/bootstrap.bundle.min.js') }}"></script>
25+
<script type="text/javascript" src="{{ url_for('static', filename='dist/js/bootstrap.bundle.js') }}"></script>
2626

2727
<!-- JQuery Javascript -->
28-
<script type="text/javascript" src="{{ url_for('static', filename='node_modules/jquery/dist/jquery.min.js') }}"></script>
28+
<script type="text/javascript" src="{{ url_for('static', filename='dist/js/jquery.bundle.js') }}"></script>
2929

3030
<!-- JS -->
3131
<script type="text/javascript" src="https://app.lizardbyte.dev/js/discord.js"></script>

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ RUN <<_NPM
6666
#!/bin/bash
6767
set -e
6868
npm install
69-
mv ./node_modules ./Contents/Resources/web
69+
npm run build
7070
_NPM
7171

7272
# clean

docs/source/contributing/build.rst

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Build
44
=====
5-
Compiling Themerr-plex is fairly simple; however it is recommended to use Python 2.7 since the Plex framework is using
5+
Compiling Themerr-plex is fairly simple; however you need to use Python 2.7 since the Plex framework is using
66
Python 2.7.
77

88
Clone
@@ -53,17 +53,7 @@ Install npm dependencies.
5353
.. code-block:: bash
5454
5555
npm install
56-
57-
Move modules directory.
58-
Linux/macOS
59-
.. code-block:: bash
60-
61-
mv ./node_modules ./Contents/Resources/web
62-
63-
Windows
64-
.. code-block:: batch
65-
66-
move .\node_modules .\Contents\Resources\web
56+
npm run build
6757
6858
Remote Build
6959
------------

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
{
2+
"scripts": {
3+
"build": "webpack"
4+
},
25
"dependencies": {
36
"@fontsource/open-sans": "5.0.20",
47
"@fortawesome/fontawesome-free": "6.5.1",
58
"bootstrap": "5.3.2",
69
"jquery": "3.7.1"
10+
},
11+
"devDependencies": {
12+
"css-loader": "6.10.0",
13+
"mini-css-extract-plugin": "2.8.1",
14+
"webpack": "5.90.3",
15+
"webpack-cli": "5.1.4"
716
}
817
}

webpack.config.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const path = require('path');
2+
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3+
4+
module.exports = {
5+
entry: {
6+
bootstrap: [
7+
'bootstrap/dist/js/bootstrap.bundle.min.js',
8+
'bootstrap/dist/css/bootstrap.min.css'
9+
],
10+
fontawesome: '@fortawesome/fontawesome-free/css/all.min.css',
11+
jquery: 'jquery/dist/jquery.min.js',
12+
'open-sans': '@fontsource/open-sans/index.css',
13+
},
14+
output: {
15+
filename: 'js/[name].bundle.js',
16+
path: path.resolve(__dirname, 'Contents', 'Resources', 'web', 'dist'),
17+
},
18+
mode: 'production',
19+
module: {
20+
rules: [
21+
{
22+
test: /\.css$/,
23+
use: [MiniCssExtractPlugin.loader, 'css-loader'],
24+
},
25+
],
26+
},
27+
plugins: [
28+
new MiniCssExtractPlugin({
29+
filename: 'css/[name].bundle.css',
30+
}),
31+
],
32+
};

0 commit comments

Comments
 (0)