Skip to content

Instantly share code, notes, and snippets.

@Coneko
Created August 18, 2012 23:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Coneko/3390331 to your computer and use it in GitHub Desktop.
Save Coneko/3390331 to your computer and use it in GitHub Desktop.
r.js failing to optimize OpenLayers
({
name: "almond",
out: "main-built.js",
include: ["main"],
insertRequire: ["main"],
wrap: true, // This is the crucial option
mainConfigFile: "main.js",
optimize: "none"
})
<!DOCTYPE html>
<html>
<head>
<!-- <script src="require.js" data-main="main"></script> -->
<script src="main-built.js"></script>
</head>
<body>
</body>
</html>
requirejs.config({
paths: {
openlayers: 'OpenLayers.debug'
},
shim: {
openlayers: {
exports: 'OpenLayers'
}
}
});
require(['openlayers'], function(test) {
return console.log(test);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment