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}";
task_end $?;
task_begin "Copying css";
# FUTURE: Package this up too?
cp -r client_src/css/ "${build_output_folder}";
task_end $?;
# task_begin "Copying css";
# # FUTURE: Package this up too?
# cp -r client_src/css/ "${build_output_folder}";
# task_end $?;
}
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>
</head>
<body>
content here
<!---------------->
<link rel="stylesheet" href="/css/main.css" />
<link rel="stylesheet" href="client.css" />
<script src="app.js" charset="utf-8"></script>
</body>
</html>

View file

@ -1,5 +1,7 @@
"use strict";
import '../css/main.css';
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"
},
"devDependencies": {
"postcss-import": "^12.0.1",
"postcss-url": "^8.0.0",
"rollup": "^1.1.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 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 {
input: 'client_src/js/index.mjs',
@ -33,6 +37,20 @@ export default {
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
})
]
};