0.1.0 • Published 4 years ago

replace-require-and-define v0.1.0

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
4 years ago

replace-require-and-define

Rename require and define to support esri Ember addons such as ember-cli-amd and ember-esri-loader.

You probably don't need to use this library directly. If you are trying to use the ArcGIS API for JavaScript in an Ember app, try one of the above addons.

The issue is that the Ember Loader defines the same globals require and define but are not AMD compatible.

The solution is to make the Ember Loader not conflicting anymore by renaming those globals and replacing calls to them using the new names.

Usage

npm install --save replace-require-and-define

Then in a Broccoli filter, run:

const modifiedSource = replaceRequireAndDefine(code, amdPackages, externalAmdModulesForFile);

The amdPackages and externalAmdModulesForFile are optional. See the ember-cli-amd documentation for more info.

Resources

Issues

Find a bug or want to request a new feature? Please let us know by submitting an issue.

Contributing

Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

Licensing

Copyright 2018 Esri

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

A copy of the license is available in the repository's LICENSE file