What is Effective
Assembling modules into a single outFile with a declaration file has proven to be successful:
{
"compilerOptions": {
"module": "amd",
"target": "es5",
"declaration": true,
"noImplicitAny": false,
"outFile": "built/index.js",
"sourceMap": true
},
"exclude": [
"bower_components",
"built"
]
}
For setting up the dependent project, importing via bower and typings has been beneficial:
>bower install git://github.com/ca0v/ol3-symbolizer.git#v3.20.1 --save
>typings install ol3-symbolizer=github:ca0v/ol3-symbolizer/built/index.d.ts#v3.20.1 --save --global
Including the dependency in the AMD "dep" array helps facilitate this process:
deps: [
"https://rawgit.com/ca0v/ol3-symbolizer/v3.20.1/built/index.js",
"https://rawgit.com/ca0v/ol3-layerswitcher/v3.20.1/built/index.js",
"https://rawgit.com/ca0v/ol3-popup/v3.20.1/built/index.js",
"built/index"
],
The Question Now Arises.
I would prefer not using deps
or typings
at all, but instead directly referencing the dependency:
import Symbolizer = require("../../bower_components/ol3-symbolizer/format/ags-symbolizer");
This method works well in cases without nested dependencies. However, when ol3-symbolizer also depends on ol3-popup, using bower
to install ol3-symbolizer
causes file structure flattening and breaks the references:
import { Popup } from "../bower_components/ol3-popup/src/ol3-popup";
To rectify this issue, it should be changed to:
import { Popup } from "../../ol3-popup/src/ol3-popup";
Is there a way to organize these projects to prevent these path disruptions?