From 5457f68c703d403f6d771ebc5a66d3c4e3f146e5 Mon Sep 17 00:00:00 2001 From: Bogdan Bodnar Date: Mon, 30 Sep 2019 11:27:13 +0200 Subject: [PATCH] Download docs css via NPM. --- package-lock.json | 34 ++++++++++++++++++++++++++++++++++ package.json | 3 +++ styleguide.config.js | 21 +++++++-------------- 3 files changed, 44 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index a523ee9..0f7df9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -975,6 +975,12 @@ } } }, + "@fortawesome/fontawesome-free": { + "version": "5.11.2", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.11.2.tgz", + "integrity": "sha512-XiUPoS79r1G7PcpnNtq85TJ7inJWe0v+b5oZJZKb0pGHNIV6+UiNeQWiFGmuQ0aj7GEhnD/v9iqxIsjuRKtEnQ==", + "dev": true + }, "@jest/console": { "version": "24.9.0", "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.9.0.tgz", @@ -2318,6 +2324,12 @@ "multicast-dns-service-types": "^1.1.0" } }, + "bootstrap": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.3.1.tgz", + "integrity": "sha512-rXqOmH1VilAt2DyPzluTi2blhk17bO7ef+zLLPlWvG494pDxcM234pJ8wTc/6R40UWizAIIMgxjvxZg5kmsbag==", + "dev": true + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -4853,6 +4865,28 @@ "flat-cache": "^2.0.1" } }, + "file-loader": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-4.2.0.tgz", + "integrity": "sha512-+xZnaK5R8kBJrHK0/6HRlrKNamvVS5rjyuju+rnyxRGuwUJwpAMsVzUl5dz6rK8brkzjV6JpcFNjp6NqV0g1OQ==", + "dev": true, + "requires": { + "loader-utils": "^1.2.3", + "schema-utils": "^2.0.0" + }, + "dependencies": { + "schema-utils": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.4.1.tgz", + "integrity": "sha512-RqYLpkPZX5Oc3fw/kHHHyP56fg5Y+XBpIpV8nCg0znIALfq3OH+Ea9Hfeac9BAMwG5IICltiZ0vxFvJQONfA5w==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "ajv-keywords": "^3.4.1" + } + } + } + }, "filesize": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", diff --git a/package.json b/package.json index 910d785..5686620 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@babel/plugin-transform-runtime": "^7.4.4", "@babel/preset-env": "^7.4.5", "@babel/preset-react": "^7.0.0", + "@fortawesome/fontawesome-free": "^5.11.2", "@testing-library/react": "^8.0.9", "babel-eslint": "^9.0.0", "babel-jest": "^24.8.0", @@ -43,6 +44,7 @@ "babel-plugin-module-resolver": "^3.2.0", "babel-plugin-react-transform": "^3.0.0", "babel-polyfill": "^6.26.0", + "bootstrap": "^4.3.1", "copy-webpack-plugin": "^5.0.4", "css-loader": "^3.2.0", "eslint": "^6.1.0", @@ -51,6 +53,7 @@ "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-react": "^7.14.3", "eslint-plugin-react-hooks": "^1.7.0", + "file-loader": "^4.2.0", "jest": "^24.8.0", "jest-mock-axios": "^3.0.0", "moment": "^2.24.0", diff --git a/styleguide.config.js b/styleguide.config.js index 128925c..ec86203 100644 --- a/styleguide.config.js +++ b/styleguide.config.js @@ -5,6 +5,8 @@ * See /LICENSE for more information. */ +const path = require("path"); + module.exports = { title: "Foris JS docs", sections: [ @@ -33,20 +35,11 @@ module.exports = { ], }, ], - template: { - head: { - links: [ - { - rel: "stylesheet", - href: "https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css", - }, - { - rel: "stylesheet", - href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css", - }, - ], - }, - }, + require: [ + "babel-polyfill", + path.join(__dirname, "node_modules/bootstrap/dist/css/bootstrap.min.css"), + path.join(__dirname, "node_modules/@fortawesome/fontawesome-free/css/all.min.css"), + ], webpackConfig: { module: { rules: [