Update for ol@5
This commit is contained in:
parent
3e5641a20a
commit
2939d90df1
|
@ -3,6 +3,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Using OpenLayers with Webpack</title>
|
||||
<link rel="stylesheet" href="https://openlayers.org/en/latest/css/ol.css" type="text/css">
|
||||
<style>
|
||||
html, body {
|
||||
margin: 0;
|
||||
|
|
8
main.js
8
main.js
|
@ -1,8 +1,6 @@
|
|||
import 'ol/ol.css';
|
||||
import Map from 'ol/map';
|
||||
import View from 'ol/view';
|
||||
import TileLayer from 'ol/layer/tile';
|
||||
import XYZ from 'ol/source/xyz';
|
||||
import {Map, View} from 'ol';
|
||||
import TileLayer from 'ol/layer/Tile';
|
||||
import XYZ from 'ol/source/XYZ';
|
||||
|
||||
new Map({
|
||||
target: 'map',
|
||||
|
|
|
@ -3,14 +3,13 @@
|
|||
"version": "1.0.0",
|
||||
"description": "Example using OpenLayers with Webpack",
|
||||
"scripts": {
|
||||
"build": "webpack --config webpack.config.js"
|
||||
"build": "webpack --config webpack.config.js --mode production"
|
||||
},
|
||||
"devDependencies": {
|
||||
"css-loader": "^0.28.4",
|
||||
"style-loader": "^0.18.2",
|
||||
"webpack": "^3.3.0"
|
||||
"webpack": "^4.12.1",
|
||||
"webpack-command": "^0.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"ol": "^4.2.0"
|
||||
"ol": "^5.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,20 +3,7 @@ const webpack = require('webpack');
|
|||
module.exports = {
|
||||
entry: './main.js',
|
||||
output: {
|
||||
path: __dirname,
|
||||
filename: 'bundle.js'
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.css$/,
|
||||
use: [
|
||||
{loader: 'style-loader'},
|
||||
{loader: 'css-loader'}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
plugins: [
|
||||
new webpack.optimize.UglifyJsPlugin()
|
||||
]
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue