Build css with rollup too!

This commit is contained in:
Starbeamrainbowlabs 2019-01-17 12:48:09 +00:00
parent 6882ff4737
commit c45db0ddee
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
7 changed files with 3125 additions and 7 deletions

8
build
View File

@ -136,10 +136,10 @@ function task_client {
cp client_src/index.html "${build_output_folder}"; cp client_src/index.html "${build_output_folder}";
task_end $?; task_end $?;
task_begin "Copying css"; # task_begin "Copying css";
# FUTURE: Package this up too? # # FUTURE: Package this up too?
cp -r client_src/css/ "${build_output_folder}"; # cp -r client_src/css/ "${build_output_folder}";
task_end $?; # task_end $?;
} }
function task_client-watch { function task_client-watch {

View File

@ -0,0 +1 @@
@import "../../node_modules/leaflet/dist/leaflet.css";

View File

@ -5,10 +5,10 @@
<title>Air Quality Map | ConnectedHumber</title> <title>Air Quality Map | ConnectedHumber</title>
</head> </head>
<body> <body>
content here
<!----------------> <!---------------->
<link rel="stylesheet" href="/css/main.css" /> <link rel="stylesheet" href="client.css" />
<script src="app.js" charset="utf-8"></script> <script src="app.js" charset="utf-8"></script>
</body> </body>
</html> </html>

View File

@ -1,5 +1,7 @@
"use strict"; "use strict";
import '../css/main.css';
window.addEventListener("load", function(_event) { window.addEventListener("load", function(_event) {
}); });

3094
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -23,8 +23,11 @@
"leaflet-webgl-heatmap": "^0.2.7" "leaflet-webgl-heatmap": "^0.2.7"
}, },
"devDependencies": { "devDependencies": {
"postcss-import": "^12.0.1",
"postcss-url": "^8.0.0",
"rollup": "^1.1.0", "rollup": "^1.1.0",
"rollup-plugin-commonjs": "^9.2.0", "rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^4.0.0" "rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-postcss": "^1.6.3"
} }
} }

View File

@ -1,5 +1,9 @@
import resolve from 'rollup-plugin-node-resolve'; import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs'; import commonjs from 'rollup-plugin-commonjs';
import postcss from 'rollup-plugin-postcss';
import postcss_import from 'postcss-import';
import postcss_url from 'postcss-url';
export default { export default {
input: 'client_src/js/index.mjs', input: 'client_src/js/index.mjs',
@ -33,6 +37,20 @@ export default {
commonjs({ commonjs({
}),
postcss({
plugins: [
postcss_import({}),
postcss_url({
url: "rebase"
})
],
// Save it to a .css file - we'll reference it ourselves thank you
// very much
extract: true,
sourceMap: true,
//minimize: true, // Causes an error at the moment for some reason
}) })
] ]
}; };