Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

use scss and update packages

goenning34cf0668dd4b
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 268d6039a..da52c0117 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -12,14 +12,14 @@
"fider": true,
"fider.exe": true,
"tmp": true,
- "vendor": false,
"node_modules": true,
"dist": true,
"coverage.txt": true,
"debug": true,
"**/debug.test": true,
".cover": true,
- "cover.out": true
+ "cover.out": true,
+ "vendor": true
},
"search.exclude": {
"**/node_modules": true,
diff --git a/app/pkg/web/renderer.go b/app/pkg/web/renderer.go
index 243a5fedb..c55f39535 100644
--- a/app/pkg/web/renderer.go
+++ b/app/pkg/web/renderer.go
@@ -78,5 +78,10 @@ func (r *HTMLRenderer) Render(w io.Writer, name string, data interface{}, c echo
m["__JavaScriptBundle"] = files[0].Name()
}
+ files, _ = ioutil.ReadDir("dist/css")
+ if len(files) > 0 {
+ m["__StyleBundle"] = files[0].Name()
+ }
+
return tmpl.Execute(w, m)
}
diff --git a/package.json b/package.json
index f918321d3..0dfd38e98 100644
--- a/package.json
+++ b/package.json
@@ -19,19 +19,21 @@
"semantic-ui-css": "^2.2.10"
},
"devDependencies": {
- "@types/jquery": "^2.0.41",
+ "@types/jquery": "^2.0.45",
"@types/md5": "^2.1.32",
- "@types/react": "^15.0.22",
+ "@types/react": "^15.0.24",
"@types/react-dom": "^15.5.0",
- "clean-webpack-plugin": "^0.1.16",
- "css-loader": "^0.28.0",
+ "css-loader": "^0.28.1",
+ "extract-text-webpack-plugin": "^2.1.0",
"file-loader": "^0.11.1",
+ "node-sass": "^4.5.3",
"rimraf": "^2.6.1",
- "style-loader": "^0.16.1",
+ "sass-loader": "^6.0.5",
"ts-loader": "^2.0.3",
- "tslint": "^5.1.0",
- "typescript": "^2.2.2",
- "webpack": "^2.4.1"
+ "tslint": "^5.2.0",
+ "typescript": "^2.3.2",
+ "webpack": "^2.5.1",
+ "webpack-clean-obsolete-chunks": "^0.1.9"
},
"engines": {
"node": "6.10.0"
diff --git a/public/index.tsx b/public/index.tsx
index dbf5991a1..9f24206bc 100644
--- a/public/index.tsx
+++ b/public/index.tsx
@@ -6,7 +6,7 @@ import { HomePage as SiteHomePage } from "./site/HomePage";
import { ShowIdeaPage } from "./site/ShowIdeaPage";
import { setup } from "./storage";
-import "./css/main.css";
+import "./style/main.scss";
const pathRegex = [
{ regex: new RegExp("^\/$"), component: <SiteHomePage /> },
diff --git a/public/css/main.css b/public/style/main.scss
similarity index 74%
rename from public/css/main.css
rename to public/style/main.scss
index 96f2af9fe..05f989b7d 100644
--- a/public/css/main.css
+++ b/public/style/main.scss
@@ -10,20 +10,14 @@
margin-left: 20px;
}
-#footer {
- margin-top: 50px;
-}
-
.idea-header {
margin-left: 20px;
}
.support-button {
- width: 60px;
-}
-
-.support-button i.icon {
- margin: 0px;
+ i.icon {
+ margin: 0px;
+ }
}
.no-border {
@@ -42,10 +36,16 @@
padding: 10px 5px !important;
}
-#footer #powered-by {
- text-align: center;
+#footer {
+ margin-top: 50px;
+
+ #powered-by {
+ text-align: center;
+
+ img {
+ width: 30px;
+ filter: grayscale(100%)
+ }
+ }
}
-#footer #powered-by img {
- width: 30px;
-}
\ No newline at end of file
diff --git a/views/base.html b/views/base.html
index a11f8c8d6..684fbf2ff 100644
--- a/views/base.html
+++ b/views/base.html
@@ -5,6 +5,7 @@
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.9/semantic.min.css" integrity="sha256-lCqHBvboFPu7gyEswcz5UdbXKyB6FDOtfbOeMvUEfkY=" crossorigin="anonymous" />
+ <link rel="stylesheet" href="/assets/css/{{ .__StyleBundle }}" />
<title>{{template "title" .}}</title>
</head>
<body>
diff --git a/webpack.config.js b/webpack.config.js
index f386143ab..c276faf8c 100755
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,5 +1,6 @@
const path = require('path');
-const CleanWebpackPlugin = require('clean-webpack-plugin');
+const ExtractTextPlugin = require('extract-text-webpack-plugin');
+const CleanObsoleteChunks = require('webpack-clean-obsolete-chunks');
module.exports = {
entry: "./public/index.tsx",
@@ -14,7 +15,10 @@ module.exports = {
},
module: {
rules: [
- { test: /\.css$/, loader: "style-loader!css-loader" },
+ {
+ test: /\.scss$/,
+ loader: ExtractTextPlugin.extract("css-loader!sass-loader")
+ },
{ test: /\.(ts|tsx)$/, loader: "ts-loader" },
{
test: /\.(eot|svg|ttf|woff|woff2)$/,
@@ -27,11 +31,11 @@ module.exports = {
]
},
plugins: [
- new CleanWebpackPlugin(['dist'], {
- root: __dirname,
- verbose: true,
- dry: false,
- watch: true
+ new CleanObsoleteChunks(),
+ new ExtractTextPlugin({
+ filename: 'css/[name].[hash].css',
+ disable: false,
+ allChunks: true
})
],
externals: {