bundle with non relative path
- Dominant language
- JavaScript
- Stars
- 402
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Description
**I'm submitting a bug report**
* **Library Version:**
aurelia-cli 0.24
**Please tell us about your environment:**
* **Operating System:**
Windows 10
* **Node Version:**
5.11.0
* **NPM Version:**
3.10.8
* **Browser:**
all
* **Language:**
TypeScript 2.1
**Current behavior:**
See this [stack overflow question](http://stackoverflow.com/questions/42411567/aurelia-bundling-fails-when-using-relative-import-path).
When using non-relative path imports, the bundling fails. For instance, if I import a class like this:
`import { DialogBox } from '../../resources/elements/dialog-box';`
the bundling works whereas if I import it like this:
`import { DialogBox } from 'resources/elements/dialog-box';`
the bundling fails. This happens during the bundling phase of aurelia-cli's build (with au run --watch) so it means that the typescript compilation worked correctly. VSCode doesn't complain about either relative or absolute path either...
The error I get that interrupts the build:
`{ uid: 11,
name: 'writeBundles',
branch: false,
error:
{ [Error: ENOENT: no such file or directory, open 'C:\Users\GMA\Doc
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'C:\\Users\\GMA\\Documents\\Sources\\ProtoSAMWeb\\FluBAO\\D
duration: [ 0, 8865477 ],
...`
**Expected/desired behavior:**
I'd like the bundling not to fail when using 'root-relative' imports.
* **What is the motivation / use case for changing the behavior?**
Having to use relative path everywhere makes the imports much less clear and harder to maintain for our developers.
Contributor guide
Research direction
Start with the bundling phase triggered by `au run --watch` and compare the handling of the relative and root-relative TypeScript imports shown in the report. Reproduce the failure on the stated Windows environment, then verify that bundling completes successfully when importing `resources/elements/dialog-box` without a relative prefix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100