Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed uglify because of es6 issues when building. Added loaded prom… #741

Open
wants to merge 1 commit into
base: vue2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions config/webpack.production.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')

const config = {
Expand All @@ -9,11 +8,6 @@ const config = {
],
optimization: {
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: true
}),
new OptimizeCSSAssetsPlugin({})
]
},
Expand Down
Empty file modified dist/.babelrc
100755 → 100644
Empty file.
3,258 changes: 3,257 additions & 1 deletion dist/vue-google-maps.js
100755 → 100644

Large diffs are not rendered by default.

10,067 changes: 0 additions & 10,067 deletions package-lock.json

This file was deleted.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
},
"homepage": "https://github.com/xkjyeah/vue-google-maps#readme",
"dependencies": {
"marker-clusterer-plus": "^2.1.4"
"marker-clusterer-plus": "^2.1.4",
"terser-webpack-plugin": "^4.1.0"
},
"peerDependencies": {
"vue": "^2.6.10"
Expand Down
11 changes: 9 additions & 2 deletions src/factories/promise-lazy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import lazy from '../utils/lazy-value'

let resolveLoaded
let rejectLoaded
export const loaded = new Promise((resolve, reject) => {
resolveLoaded = resolve
rejectLoaded = reject
})

export default function (loadGmapApi, GmapApi) {
return function promiseLazyCreator (options) {
// Things to do once the API is loaded
Expand All @@ -21,7 +28,7 @@ export default function (loadGmapApi, GmapApi) {
} catch (err) {
reject(err)
}
}).then(onApiLoaded)
}).then(onApiLoaded).then(resolveLoaded).catch(rejectLoaded)
}
})
} else { // If library should not handle API, provide
Expand All @@ -33,7 +40,7 @@ export default function (loadGmapApi, GmapApi) {
return
}
window.vueGoogleMapsInit = resolve
}).then(onApiLoaded)
}).then(onApiLoaded).then(resolveLoaded).catch(rejectLoaded)

return lazy(() => promise)
}
Expand Down
2 changes: 2 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import MapElementMixin from './mixins/map-element'
import MapElementFactory from './factories/map-element'
import MountableMixin from './mixins/mountable'

export { loaded } from './factories/promise-lazy'

// HACK: Cluster should be loaded conditionally
// However in the web version, it's not possible to write
// `import 'vue2-google-maps/src/components/cluster'`, so we need to
Expand Down
6,719 changes: 6,719 additions & 0 deletions yarn.lock

Large diffs are not rendered by default.