Просмотр исходного кода

Merge pull request #3994 from weseek/fix/refs-bootstrap

fix statics settings for bootstrap
Yuki Takei 4 лет назад
Родитель
Сommit
538f9904e8

+ 1 - 0
packages/slackbot-proxy/.gitignore

@@ -0,0 +1 @@
+src/public/bootstrap

+ 4 - 1
packages/slackbot-proxy/package.json

@@ -4,15 +4,18 @@
   "license": "MIT",
   "scripts": {
     "build": "yarn tsc && tsc-alias -p tsconfig.build.json && yarn postbuild",
-    "postbuild": "yarn cp:public && yarn cp:views",
     "cp:public": "mkdir -p ./dist/public && cp -r ./src/public ./dist",
     "cp:views": "mkdir -p ./dist/views && cp -r ./src/views ./dist",
+    "cp:bootstrap": "mkdir -p ./dist/public/bootstrap && cp -r ./node_modules/bootstrap/dist ./dist/public/bootstrap",
+    "cp:bootstrap:dev": "cp -r ./node_modules/bootstrap/dist ./src/public/bootstrap",
     "tsc": "tsc -p tsconfig.build.json",
     "tsc:w": "yarn tsc -w",
     "dev:ci": "yarn dev --ci",
     "dev": "cross-env NODE_ENV=development ts-node-dev -r tsconfig-paths/register -r dotenv-flow/config src/index.ts",
     "start:prod:ci": "yarn start:prod --ci",
     "start:prod": "cross-env NODE_ENV=production node -r dotenv-flow/config dist/index.js",
+    "postbuild": "yarn cp:public && yarn cp:views && yarn cp:bootstrap",
+    "predev": "yarn cp:bootstrap:dev",
     "test": "yarn test:lint && yarn test:coverage",
     "test:unit": "cross-env NODE_ENV=test jest --passWithNoTests",
     "test:coverage": "yarn test:unit",

+ 0 - 10
packages/slackbot-proxy/src/Server.ts

@@ -103,16 +103,6 @@ const helmetOptions = isProduction ? {} : {
         root: `${rootDir}/public`,
       },
     ],
-    '/css': [
-      {
-        root: `${rootDir}/../node_modules/bootstrap/dist/css`,
-      },
-    ],
-    '/js': [
-      {
-        root: `${rootDir}/../node_modules/bootstrap/dist/js`,
-      },
-    ],
   },
 })
 export class Server {

+ 1 - 1
packages/slackbot-proxy/src/views/commons/head.ejs

@@ -5,5 +5,5 @@
   <meta name="description" content="GROWI is a wiki that can be written in Markdown and easy to share information with everyone.">
   <link rel="shortcut icon" href="/images/growi-bot.png">
   <title>GROWI Official Bot</title>
-  <link href="./css/bootstrap.min.css" rel="stylesheet" >
+  <link href="/bootstrap/css/bootstrap.min.css" rel="stylesheet" >
 </html>