Browse Source

Build css with rollup too!

pull/26/head
Starbeamrainbowlabs 3 years ago
parent
commit
c45db0ddee
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
  1. 8
      build
  2. 1
      client_src/css/main.css
  3. 4
      client_src/index.html
  4. 2
      client_src/js/index.mjs
  5. 3192
      package-lock.json
  6. 5
      package.json
  7. 18
      rollup.config.js

8
build

@ -136,10 +136,10 @@ function task_client { @@ -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 {

1
client_src/css/main.css

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

4
client_src/index.html

@ -5,10 +5,10 @@ @@ -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>

2
client_src/js/index.mjs

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

3192
package-lock.json generated

File diff suppressed because it is too large Load Diff

5
package.json

@ -23,8 +23,11 @@ @@ -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"
}
}

18
rollup.config.js

@ -1,5 +1,9 @@ @@ -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 { @@ -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
})
]
};

Loading…
Cancel
Save