Prechádzať zdrojové kódy

Refine docs and build website CSS as part of the `build` step

JC Brand 2 týždňov pred
rodič
commit
d545f904ef

+ 7 - 7
docs/source/quickstart.rst

@@ -68,18 +68,18 @@ B. Download Pre-built Files
 C. Build from Source
 ********************
 
-For custom builds and development:
+For custom builds and development, run the following commands:
 
-1. Clone the `Converse repository <https://github.com/conversejs/converse.js/>`_ by running ``git clone git@github.com:conversejs/converse.js.git``
-2. Run ``npm install`` to install dependencies
-3. Run ``npm run build`` to build distribution files to the ``./dist`` folder
-4. Run ``npm run serve -- -p 8008`` to start a local server at port ``8008``.
-5. You can now access Converse at http://localhost:8008/dev.html in your browser.
+1. ``git clone git@github.com:conversejs/converse.js.git`` to clone the repo.
+2. ``cd converse.js && npm install`` to install dependencies
+3. ``npm run build`` to build distribution files to the ``./dist`` folder
+4. ``npm run serve`` to start a local server at port ``8080``.
+5. You can now access Converse at http://localhost:8080/dev.html in your browser.
 
 See the :ref:`creating_builds` section for detailed build instructions and customization options.
 
 .. tip::
-    If you have GNU Make installed, you can run ``make watch``, to do all the above steps automatically.
+    You can run ``npm run watch`` to automatically rebuild the dist files whenever a source file changes.
 
 
 Initializing Converse

+ 7 - 7
docs/source/setup_dev_environment.rst

@@ -32,17 +32,17 @@ To set up a Converse development environment, you now run the following:
 
 ::
 
-    make serve_bg
-    make watch
+    npm install
+    npm run serve &
+    npm run watch
+
 
-Alternatively, if you're using Windows, or don't have GNU Make installed, you can run the
-following:
+Alternatively, if you have GNU Make installed, you can run:
 
 ::
 
-    npm install
-    npm run serve &
-    npm run watch
+    make serve_bg
+    make watch
 
 
 Then go to http://localhost:8000/dev.html to load Converse.

+ 3 - 1
package.json

@@ -45,7 +45,9 @@
     "3rdparty/*.js"
   ],
   "scripts": {
-    "build": "webpack --config webpack/webpack.build.js",
+    "build": "npm run build:website-min-css && webpack --config webpack/webpack.build.js",
+    "build:website-css": "sass --quiet --load-path=node_modules src/shared/styles/website.scss dist/website.css",
+    "build:website-min-css": "npm run build:website-css && npx clean-css-cli dist/website.css > dist/website.min.css",
     "lint": "eslint src/**/*.js",
     "test": "karma start karma.conf",
     "cdn": "ASSET_PATH=https://cdn.conversejs.org/dist/ npm run build",