bundle with non relative path
See original GitHub issueI’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.
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.
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (12 by maintainers)
The above two commits fixes the relative paths issue, but show types errors:
Will get back to that shortly.
Full Bash session testing a build with a newly generated app in this Gist.
I didn’t read your question well, did I? haha 😅 How about updating these packages:
I noticed my ts files weren’t making it into my bundle as well even though I did not see any errors. Updating these packages seems to have fixed it.
Before:
After: