Skip to content

Commit b2df90a

Browse files
committed
Package css with examples
1 parent 2b149ed commit b2df90a

11 files changed

+21
-19
lines changed

Diff for: example/.eslintrc

-7
This file was deleted.

Diff for: example/_template.html

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
66
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
77
<title>ol-mapbox-style example</title>
8-
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css">
98
<style>
109
html, body {
1110
height: 100%;

Diff for: example/geojson-inline.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
import { apply } from 'ol-mapbox-style';
1+
import 'ol/ol.css';
2+
import {apply} from 'ol-mapbox-style';
23

34
apply('map', 'data/geojson-inline.json');

Diff for: example/geojson.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
import { apply } from 'ol-mapbox-style';
1+
import 'ol/ol.css';
2+
import {apply} from 'ol-mapbox-style';
23

34
apply('map', 'data/geojson.json');

Diff for: example/mapbox.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { apply } from 'ol-mapbox-style';
1+
import 'ol/ol.css';
2+
import {apply} from 'ol-mapbox-style';
23

34
const baseUrl = 'https://api.mapbox.com/styles/v1/mapbox/bright-v9';
45

Diff for: example/stylefunction.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
import 'ol/ol.css';
22
import VectorLayer from 'ol/layer/Vector';
33
import VectorSource from 'ol/source/Vector';
44
import GeoJsonFormat from 'ol/format/GeoJSON';

Diff for: example/tilejson-vectortile.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2-
import { apply } from 'ol-mapbox-style';
1+
import 'ol/ol.css';
2+
import {apply} from 'ol-mapbox-style';
33

44
apply('map', 'https://rawgit.com/PetersonGIS/CamoStyle/8643c1510077f268f01a5d9a1ca12c6ce080d976/camo.json');

Diff for: example/tilejson.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
import { apply } from 'ol-mapbox-style';
1+
import 'ol/ol.css';
2+
import {apply} from 'ol-mapbox-style';
23

34
apply('map', 'data/tilejson.json');

Diff for: example/wms.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2-
import { apply } from 'ol-mapbox-style';
1+
import 'ol/ol.css';
2+
import {apply} from 'ol-mapbox-style';
33

44
apply('map', 'data/wms.json');

Diff for: package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@
6161
"license": "BSD-2-Clause",
6262
"scripts": {
6363
"start": "webpack-dev-server --config ./webpack.config.js",
64-
"prepublish": "npm run doc",
64+
"prepare": "npm run doc && npm run build",
6565
"build": "webpack-cli --config ./webpack.config.js",
6666
"doc": "documentation readme -s API index.js",
67-
"lint": "eslint __test__ *.js",
67+
"lint": "eslint __test__ example *.js",
6868
"pretest": "npm run lint",
6969
"test": "jest",
7070
"cover": "jest --coverage"
@@ -85,6 +85,7 @@
8585
"babel-preset-env": "^1.6.1",
8686
"canvas": "^1.6.8",
8787
"copy-webpack-plugin": "^4.5.1",
88+
"css-loader": "^0.28.11",
8889
"deep-freeze": "0.0.1",
8990
"documentation": "^4.0.0-rc.1",
9091
"eslint": "^4.10.0",
@@ -101,6 +102,7 @@
101102
"regenerator-runtime": "^0.11.1",
102103
"should": "^11.2.1",
103104
"should-approximately-deep": "^1.1.0",
105+
"style-loader": "^0.20.3",
104106
"webpack": "^4.1.1",
105107
"webpack-cli": "^2.0.12",
106108
"webpack-dev-server": "^3.1.1"

Diff for: webpack.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ module.exports = {
9292
query: {
9393
cacheDirectory: true
9494
}
95+
},
96+
{
97+
test: /\.css$/,
98+
use: ['style-loader', 'css-loader']
9599
}
96100
]
97101
},

0 commit comments

Comments
 (0)