Skip to content

Commit

Permalink
Replace UMD version with simple IIFE version.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghettovoice committed Oct 24, 2019
1 parent 28042ba commit 37296b6
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 12,885 deletions.
18 changes: 0 additions & 18 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,6 @@
"plugins": [
"istanbul"
]
},
"es": {
"plugins": [
"@babel/plugin-external-helpers"
]
},
"umd": {
"plugins": [
"@babel/plugin-external-helpers",
[
"./modules/babel-plugin-merge-imports",
{
"pkg": "openlayers",
"pkgVar": "__ol__",
"regex": "^ol(?:\/(.*))?$"
}
]
]
}
}
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### Linux template
*~

Expand All @@ -56,7 +57,10 @@ fabric.properties

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### Node template
package-lock.json

# Logs
logs
*.log
Expand Down
36 changes: 17 additions & 19 deletions build/rollup.umd.config.js → build/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@ const path = require('path')
const config = require('./config')
const util = require('./util')

const output = {
format: 'umd',
file: path.join(__dirname, `../dist/bundle.js`),
sourcemap: true,
banner: config.banner,
name: config.name,
globals: {
openlayers: 'ol',
},
amd: {
id: config.amdName,
},
}

module.exports = [
{
input: config.input,
Expand All @@ -24,18 +10,30 @@ module.exports = [
replace: config.replace,
banner: config.banner,
}),
output,
output: {
format: 'es',
file: path.join(__dirname, `../dist/index.js`),
sourcemap: true,
banner: config.banner,
name: config.name,
},
},
{
input: config.input,
external: config.external,
plugins: util.plugins({
min: true,
replace: config.replace,
banner: config.banner,
}),
output: Object.assign({}, output, {
file: path.join(__dirname, `../dist/bundle.min.js`),
}),
output: {
format: 'iife',
file: path.join(__dirname, `../dist/index.iife.js`),
sourcemap: true,
banner: config.banner,
name: config.name,
globals: {
'ol/tilegrid': 'ol.tilegrid',
},
},
},
]
19 changes: 0 additions & 19 deletions build/rollup.es.config.js

This file was deleted.

7 changes: 3 additions & 4 deletions build/webpack.dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ const baseConfig = require('./webpack.base.config')
const host = process.env.HOST || 'localhost'
const port = process.env.PORT || 8080

const webpackCofnig = merge(baseConfig, {
const webpackConfig = merge(baseConfig, {
devtool: '#cheap-module-eval-source-map',
devServer: {
host,
port,
hot: true,
inline: true,
compress: true,
open: true,
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
Expand All @@ -28,8 +27,8 @@ const webpackCofnig = merge(baseConfig, {
]
})

webpackCofnig.entry = {
webpackConfig.entry = {
app: path.join(__dirname, '../test/app.js'),
}

module.exports = webpackCofnig
module.exports = webpackConfig
Loading

0 comments on commit 37296b6

Please sign in to comment.