Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grunt files expansion processing and builder's baseURL break configuration #9

Open
MisterFreeze opened this issue Dec 1, 2015 · 4 comments

Comments

@MisterFreeze
Copy link

Hello,

for two reasons, I think that grunt's files logic and builder's baseURL setting collide. First, I cannot give a src relative to the gruntfile (except using './') because when using a baseURL, its value is prepended by systemjs-builder to determine the source files's location.
So I would have to use a path relative to baseURL. This, however, breaks for grunt's files expansion.

Example 1 (breaks):

file:
./static/js/main.js
baseURL:
static
src:
js/main

Example 1 does not work because file.src is undefined as grunt's files logic cannot find ./js/main. systemjs-builder, however, would find the correct source file.

Example 2 (breaks):

file:
./static/js/main.js
baseURL:
static
src:
static/js/main.js

Example 2 gives a valid file.src value but systemjs-builder expands it to static/static/js/main.js, which does not exist.

Example 3 (works):

file:
./static/js/main.js
baseURL:
static
src:
./static/js/main.js

Example 3 works as grunt's file logic finds that file and systemjs-builder does not prepend the baseURL value as it recognizes the explicit relative path ('./').

Idea

I would suggest not to use grunt's files logic at all and let systemjs-builder do the source file expansion. This would also allow for arithmetic builds. My suggestion can be found summarized in #7 .

Kind regards

@yoavniran
Copy link
Owner

hi @MisterFreeze before I can dive into this more thoroughly I wanted to clarify something: In your post you keep mentioning "Bower" but I think you mean "Grunt". is that correct?

thanks,
Yoav

@MisterFreeze
Copy link
Author

Hi @yoavniran , you are correct. I will change this to grunt :)

@MisterFreeze MisterFreeze changed the title bower files expansion processing and builder's baseURL break configuration grunt files expansion processing and builder's baseURL break configuration Dec 1, 2015
@yoavniran
Copy link
Owner

In the project im working on now I have this set up and it works well:

options.baseURL = "./target/widget"
files src = "./target/widget/src/init.js"

Would this not be a good solution for you @MisterFreeze ?

@MisterFreeze
Copy link
Author

MisterFreeze commented Dec 2, 2015 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants