Skip to content

Commit

Permalink
adding scss to release
Browse files Browse the repository at this point in the history
  • Loading branch information
razorness committed Aug 24, 2021
1 parent 9cd3f49 commit 3064297
Show file tree
Hide file tree
Showing 6 changed files with 442 additions and 38 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ If you have ideas, improvements, suggestions etc. don't hesitate to open a pull

### Todos

- [ ] Generate separate css file to be included (currently, you have to use scss)
- [ ] Usage examples
- [ ] Demo
- [ ] API documentation
Expand Down
17 changes: 15 additions & 2 deletions build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import typescript from 'rollup-plugin-typescript2';
import minimist from 'minimist';
import Scss from 'rollup-plugin-scss';
import analyze from 'rollup-plugin-analyzer';
import Autoprefixer from 'autoprefixer';

// Get browserslist config and remove ie from es build targets
const esbrowserslist = fs.readFileSync('./.browserslistrc')
Expand Down Expand Up @@ -46,20 +47,32 @@ const baseConfig = {
'process.env.NODE_ENV': JSON.stringify('production')
},
vue : {
preprocessStyles: true
target : 'browser',
css : false,
preprocessStyles : true,
preprocessOptions: {
css: {
additionalData: `@import 'src/css/maplibre.scss';`
}
}
},
postVue: [
resolve({
extensions: [ '.js', '.jsx', '.ts', '.tsx', '.vue' ]
extensions: [ '.js', '.jsx', '.ts', '.tsx', '.vue', '.scss' ]
}),
Scss({
output : 'maplibre.css',
include : [ 'src/css/maplibre.scss' ],
watch : 'src/css',
processor : () => PostCSS([ Autoprefixer() ]),
includePaths: [
path.join(__dirname, '../../node_modules/'),
'node_modules/'
]
}),
// Process only `<style module>` blocks.
PostCSS({
extract: true,
modules: {
generateScopedName: '[local]___[hash:base64:5]'
},
Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"name": "vue-maplibre-gl",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "Vue 3 plugin for maplibre-gl",
"keywords": [
"vue",
"vue3",
"vuejs",
"vue3js",
"component",
"vue-component",
"vue3-component",
"maplibre",
"maplibre-gl",
"map"
"map",
"maptiler"
],
"author": {
"name": "Volker Nauruhn",
Expand All @@ -30,7 +32,8 @@
"types": "dist/types/src/entry.esm.d.ts",
"files": [
"dist/*",
"src/**/*.vue"
"src/**/*.vue",
"src/css/*"
],
"sideEffects": false,
"scripts": {
Expand Down Expand Up @@ -66,16 +69,17 @@
"geojson": "^0.5.0",
"maplibre-gl": "^1.15.2",
"minimist": "^1.2.5",
"node-sass": "^6.0.1",
"postcss": "^8.3.6",
"rimraf": "^3.0.2",
"rollup": "^2.56.2",
"rollup": "^2.56.3",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-postcss": "^4.0.1",
"rollup-plugin-scss": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
"rollup-plugin-vue": "^6.0.0",
"sass": "^1.38.0",
"sass": "^1.38.1",
"sass-loader": "^10.2.0",
"ttypescript": "^1.5.12",
"typescript": "^4.3.5",
Expand Down
4 changes: 4 additions & 0 deletions src/css/maplibre.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@import "map";
@import "controls";
@import "styleSwitch.control";

body {
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif;
}
1 change: 1 addition & 0 deletions src/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Object.entries(components).forEach(([ componentName, component ]) => {
if (componentName !== 'default') {
const key = componentName as Exclude<keyof NamedExports, 'default'>;
const val = component as Exclude<ExtendedPlugin, typeof plugin>;
// @ts-ignore
(plugin as ExtendedPlugin)[ key ] = val;
}
});
Expand Down
Loading

0 comments on commit 3064297

Please sign in to comment.