Compatibility
The adsum-web-map is written in ES2015+ and support Browser environments.
As this is a 3D library, it requires webgl browser support
Builds
Browser
ES5
build/adsum-web-map.js
The browser build is generated using babel-preset-env transpiled to ES5.
If you need to extend the support, please read the section Extending support
All dependencies are included, if you are wondering about optimizing it please read webpack section.
ES2015+
build/es/adsum-web-map.module.js
This build is similar to the ES5 one except it is using ES2015+ module syntax and all dependencies are imported, meaning not included in the build.
This is the file defined in the browser field on the package.json.
This means that it will be used by your webpack or rollup by default if you are targeting web.
Using it with webpack/rollup will require you to transpile them.
Webpack
The recommended way to include the library is using Webpack, as it will take all advantages of Tree Shaking and minimized ES2015+ transpiled code (transpiled code is slower to execute).
There are some environment specific implementations, so you need to make sure the proper target is configured to either
node
orweb
depending of the environment your targeting.
Just for you to know, in order to specify the platform specific code, we use the Resolve mainFields
Using this configuration will use ES2015+ build which may cause it to not work on your targeted
If you need to transpile to ES5, you need to use babel loader to transpile ALL dependencies to ensure compatibility of all your dependencies.
module: {
rules: [
{
test: /\.js$/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env']
}
}
}
]
}
You will also need to include babel-polyfill