Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

File relative values #1

Closed
marcospassos opened this issue Nov 16, 2015 · 2 comments
Closed

File relative values #1

marcospassos opened this issue Nov 16, 2015 · 2 comments

Comments

@marcospassos
Copy link

Hey folks, thanks for sharing this great plugin with us!

We've an use case where we need to replace some markups using file relative values. Perhaps, providing some constants would be a great addition to this plugin.

Example:

Constant Get replaced by
__FILE__ The current file path
__FILENAME__ The current file name
__BASEDIR__ The current base directory
{
  values: {
    PATH: '__FILE__',
    VERSION: '1.0.0',
    ENVIRONMENT: JSON.stringify( 'development' )
  }
}

Thanks in advance!

@Rich-Harris
Copy link
Contributor

@marcospassos sorry for the long delay. I've just opened #2 which tackles the problem from a different direction, by allowing values to be functions (that take a module ID). Would that meet your use case?

Rich-Harris added a commit that referenced this issue Sep 5, 2017
@Rich-Harris
Copy link
Contributor

Fixed in 1.2

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

No branches or pull requests

2 participants