Skip to content

Commit

Permalink
fix UMD build, add UMD test page
Browse files Browse the repository at this point in the history
  • Loading branch information
ghettovoice committed Mar 30, 2017
1 parent ca6fcce commit 7ce1543
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/webpack.lib-umd.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ const webpackConfig = merge(baseWebpackConfig, {
PKG_FULLNAME: `"${config.fullname}"`,
PKG_VERSION: `"${config.version}"`
}),
new webpack.optimize.UglifyJsPlugin({
...( isProduction ? [ new webpack.optimize.UglifyJsPlugin({
mangle: true,
compress: {
warnings: false
},
sourceMap: true
}),
}) ] : [] ),
// extract css into its own file
new ExtractTextPlugin({
filename: 'style.umd.css'
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"babel-runtime": "^6.23.0",
"lodash": "^4.17.4",
"ol": "^4.0.1-beta.2",
"ol-cesium": "^1.25.0",
"ol-tilecache": "^2.0.0-beta.3",
"openlayers": "^4.0.1",
"rxjs": "^5.2.0",
Expand Down Expand Up @@ -79,7 +80,7 @@
"coveralls": "^2.12.0",
"cross-env": "^3.2.4",
"cross-spawn": "^5.1.0",
"css-loader": "^0.27.3",
"css-loader": "^0.28.0",
"eslint": "^3.18.0",
"eslint-config-standard": "^7.1.0",
"eslint-friendly-formatter": "^2.0.7",
Expand Down Expand Up @@ -115,7 +116,7 @@
"lolex": "^1.6.0",
"mocha": "^3.2.0",
"nightwatch": "^0.9.14",
"node-sass": "^4.5.1",
"node-sass": "^4.5.2",
"opn": "^4.0.2",
"optimize-css-assets-webpack-plugin": "^1.3.0",
"ora": "^1.2.0",
Expand All @@ -128,10 +129,10 @@
"sinon-chai": "^2.9.0",
"text-loader": "0.0.1",
"url-loader": "^0.5.8",
"vue": "^2.2.5",
"vue-loader": "^11.3.3",
"vue-style-loader": "^2.0.4",
"vue-template-compiler": "^2.2.5",
"vue": "^2.2.6",
"vue-loader": "^11.3.4",
"vue-style-loader": "^2.0.5",
"vue-template-compiler": "^2.2.6",
"webpack": "^2.3.2",
"webpack-bundle-analyzer": "^2.3.1",
"webpack-dev-middleware": "^1.10.1",
Expand Down
47 changes: 47 additions & 0 deletions test/umd.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>vuelayers umd</title>

<link rel="stylesheet" href="../dist/style.umd.css" />
<style>
html, body, #app {
width : 100%;
height : 100%;
margin : 0;
box-sizing : border-box;
font-family : Helvetica, Arial, sans-serif;
overflow : hidden;
}

body * {
box-sizing : border-box;
}
</style>
</head>
<body>
<div id="app">
<vl-map>
<vl-view :center="[0, 0]" :zoom="3"></vl-view>

<vl-layer-tile id="mapbox">
<vl-source-mapbox map-id="ghettovoice.nbm2olb0"
access-token="pk.eyJ1IjoiZ2hldHRvdm9pY2UiLCJhIjoiMzMxYzMyMWQ3NTgzMTU4Nzk3ZTNmMmI3MmQ1NmVhMjgifQ._erAEzdvdB0jfYXXqzOJCg">
</vl-source-mapbox>
</vl-layer-tile>
</vl-map>
</div>

<script src="../node_modules/vue/dist/vue.js"></script>
<script src="../dist/index.umd.js"></script>
<script>
Vue.use(VueLayers)

let vm = new Vue({
el: '#app'
})
</script>
</body>
</html>

0 comments on commit 7ce1543

Please sign in to comment.