aurelia / cli

The Aurelia 1 command line tool. Use the CLI to create projects, scaffold components, and bundle your app for release.
MIT License
407 stars 133 forks source link

Use of symlinks in src does not work #772

Closed Jule- closed 2 years ago

Jule- commented 6 years ago

I'm submitting a bug report

Please tell us about your environment:

Current behavior: Following this kind of project hierarchy:

rootFolder
├── projectA
│   ├── aurelia_project
│   ├── src
│   │   ├── main.js
│   │   ├── shared_sources -> ../../shared_sources
├── projectB
│   ├── aurelia_project
│   ├── src
│   │   ├── main.js
│   │   ├── shared_sources -> ../../shared_sources
├── shared_sources
│   ├── class.js

And assuming that each main.js have an import Class from './shared_sources/class';, when I try to build with au build I have some errors due to symlinks. If I past class.js in a standard folder all goes fine.

Error:

commonJs.convert: COULD NOT CONVERT: C:/rootFolder/projectA/src/shared_sources/class.js, so skipping it. Error was: Error: Line 1: Unexpected token
Error occurred while tracing
{ Error: Parse error using esprima for file: C:/rootFolder/projectA/src/shared_sources/class.js
Error: Line 1: Unexpected token
    at Object.context.load (C:\rootFolder\projectA\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:392:21)
    at Object.load (eval at <anonymous> (C:\rootFolder\projectA\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:14:9), <anonymous>:832:29)
    at Object.fetch (eval at <anonymous> (C:\rootFolder\projectA\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:14:9), <anonymous>:822:66)
    at Object.check (eval at <anonymous> (C:\rootFolder\projectA\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:14:9), <anonymous>:854:30)
    at Object.enable (eval at <anonymous> (C:\rootFolder\projectA\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:14:9), <anonymous>:1173:22)
    at Object.enable (eval at <anonymous> (C:\rootFolder\projectA\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:14:9), <anonymous>:1554:39)
    at Object.context.enable (C:\rootFolder\projectA\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:292:24)
    at Object.eval (eval at <anonymous> (C:\rootFolder\projectA\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:14:9), <anonymous>:1158:33)
    at eval (eval at <anonymous> (C:\rootFolder\projectA\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:14:9), <anonymous>:134:23)
    at each (eval at <anonymous> (C:\rootFolder\projectA\node_modules\aurelia-cli\lib\build\amodro-trace\lib\loader\Loader.js:14:9), <anonymous>:59:31)
  moduleTree: [ 'main' ],
  fileName: 'C:/rootFolder/projectA/src/main.js' }
Alexander-Taran commented 2 years ago

@3cp is this still relevant?

3cp commented 2 years ago

This works on latest skeleton. It's probably some default change between gulp v3 and v4.

If having trouble with symlink with latest skeleton, try gulp.src's options follow: true. https://gulpjs.com/docs/en/api/src#options

3cp commented 2 years ago

The gulp.src option can be edited in various files in aurelia_project/tasks/ whenever gulp.src is used.

3cp commented 2 years ago

Oh, it works on macOS where symlink is true symlink. No sure about windows, I guess symlink is simulated on the platform which causes many trouble. (My knowledge might be wrongly based outdated file system in windows)

Alexander-Taran commented 2 years ago

@3cp thank you