Hi guys,
I have to integrate a legacy JavaScript pluging leaflet-draw
in existing Aurelia v1 that uses requirejs
. The plugin leaflet-draw
requires leaflet
exposes as global L
variable.
The problem is, I cannot find the documentation for CLI Bundler any more. I remember that there was a section discussing different approaches for various legacy JavaScript libraries in there - how to configure bundles and dependencies in aurelia.json
file.
The closest I found in new version of docs is almost an empty page saying that:
you can edit aurelia.json
for advanced customization.
Configuration with aurelia.json | Aurelia 1 Docs
Can I find somewhere the old documentation? Git, old link, something else?
OK,
I have found what I was looking for here:
---
name: CLI's built-in Bundler Dependency Management
description: Dependency Management of the CLI built-in Bundler.
author: Chunpeng Huo (https://github.com/huochunpeng)
---
## Introduction
This page covers the details of dependency management in latest built-in bundler. The new implementation, auto tracing, brings the user experience of built-in bundler to the level of Webpack, while maintaining unique flexibility thanks for the runtime capability of RequireJS and SystemJS.
## Auto Tracing
CLI's built-in bundler behaves very similar to Webpack plus aurelia-webpack-plugin.
1. auto traces JavaScript dependencies, supports CommonJS, AMD, UMD, and Native ES Module format.
2. auto stubs core Node.js modules for running in browser, use exact same stubs that Webpack and Browserify use.
3. auto traces js/html/css dependencies in Aurelia view templates `<require from="..."></require>`.
It also provides features above Webpack.
1. wrapping `"moduleName"` with `PLATFORM.moduleName("moduleName")` is not required. The built-in bundler understands all Aurelia's convention without the help of `PLATFORM.moduleName`.
2. in esnext app, `au run --auto-install` to help you install npm packages. You can keep writing code, CLI will install missing npm packages, bundle them, and refresh you browser, see auto-install at end of this page for more details.
This file has been truncated. show original
{
"name": "leaflet-draw",
"deps": ["leaflet"],
"wrapShim": true
}
2 Likes