Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Cannot able to load .xlf file with systemjs-text-plugin.js #50

Open
divyameher opened this issue Sep 25, 2017 · 4 comments
Open

Cannot able to load .xlf file with systemjs-text-plugin.js #50

divyameher opened this issue Sep 25, 2017 · 4 comments

Comments

@divyameher
Copy link

I'm not able to load .xlf file with systemjs-text-plugin.js whereas it works fine for js,html files

@aluanhaddad
Copy link

aluanhaddad commented Sep 25, 2017

I cannot reproduce this, it loads such files just fine

Here is what I used:

// src/app.js
import xlf from './xml-localisation-interchange-file-format.xlf!text';
console.log(xlf);

It also works fine via meta config:

SystemJS.config({
  "meta": {
    "*.xlf": {
      "loader": "text"
    }
  }
});

and then in app.js

import xlf from './xml-localisation-interchange-file-format.xlf';
console.log(xlf);

I used the example from the Wikipedia article on the XLIFF XML dialect as a reference document.

@divyameher
Copy link
Author

divyameher commented Sep 26, 2017

@aluanhaddad If I use similar as above I'm getting Errors - cannot find module './xml-localisation-interchange-file-format.xlf' or cannot find module './xml-localisation-interchange-file-format.xlf!text'

image

@divyameher
Copy link
Author

I have found the rootcause for this problem System.import(variable) is not able to load file whereas System.import("./i18n/messages.es.xlf!text")(Hardcoding file name) works perfect. But what is the reason for System.import not accepting an expression or a variable?

@aluanhaddad
Copy link

@divyameher I do not understand the screenshot. TypeScript compile time errors are a separate and resolved matter (use declare module "*.xlf";).

Also, you can pass an expression to System.import. Can you add a sample of code that demonstrates the error.

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