Skip to content

Path resolution after build #14651

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

Closed
jonathanroze opened this issue Mar 14, 2017 · 4 comments
Closed

Path resolution after build #14651

jonathanroze opened this issue Mar 14, 2017 · 4 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@jonathanroze
Copy link

jonathanroze commented Mar 14, 2017

Hi there,

This is my problem : I use Path resolution in my TypeScript app like this =>

{
  "compilerOptions": {
    "module": "commonjs",
    "target": "es5",
    "pretty": true,
    "outDir": "./build",
    "baseUrl": ".",
    "paths": {
      "Internal/*": ["./src/*"]
    }
  }
}

And when i import my module i write that =>

import * as Interfaces from 'Internal/Interfaces';

My problem is, when i build my project with the tsc command, i can execute my js native file because import path are the same ! So, i have forgot something or ???

Thanks!

@vladima
Copy link
Contributor

vladima commented Mar 14, 2017

not sure that I understand the problem correctly. Path mappings were introduced to address the issue with flexible module loading in runtime when loader can map module id from the source code to a physical file using some additional configuration (i.e. via paths section in SystemJS or RequireJs). Module imports are never altered by the compiler - it assumes that whatever was written by user is correct and will applybaseUrl, paths and rootDirs to map this module id to a file to be used as type infor for module in design time.

@jonathanroze
Copy link
Author

@vladima Mhhh ok i understand but, when i compile my code how can i change this path by absolute path ? :/ !

@mhegazy mhegazy added the Question An issue which isn't directly actionable in code label Mar 14, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Mar 14, 2017

Presumablly you have a babel-plugin or some post-build script that updates the reference. the setting here is just to "tell" the compiler what happens at build time.

@jonathanroze
Copy link
Author

Ok great ! Thanks for your help :-)

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

3 participants