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

preproccessor cuts off the last line of a source breaking WebPack #1

Open
bbottema opened this issue Feb 19, 2016 · 12 comments
Open

preproccessor cuts off the last line of a source breaking WebPack #1

bbottema opened this issue Feb 19, 2016 · 12 comments

Comments

@bbottema
Copy link
Contributor

I'm running .ts files through ts-loader, but the preprocessor (v1.0.5) seems to break the process, even when returning the source directly.

I noticed that the last line was missing, which contains the export = statement. So it seems preprocessor cuts off the last line (I'm using a file source callback).

{
    "line": true,
    "file": false,
    "callbacks": [{
        "fileName": "all",
        "scope": "source",
        "callback": "(function fixTs(source, fileName) { return source; })"
    }]
}

Without preprocessor it produces a working bundle.js, but with it I get the following error:

error TS2306: File '/home/ubuntu/workspace/project/src/my_modules/ClassA.ts' is not a module.

I noticed that in the preprocessor the last line was missing which in my case contains the export = statement. It's solved when I add an extra empty line at the end of the file.

I made a sample project on GitHub. If you remove the empty lines at the end of ClassA.ts or ClassB.ts the build stops working.

@bbottema bbottema changed the title Even when returning source directly, ts-loader breaks when adding preprocessor preproccessor cuts off the last line of a source breaking WebPack Feb 19, 2016
@bbottema
Copy link
Contributor Author

@artificialtrends are you still maintaining this repo?

@PragJared
Copy link

Yes I am. Looking into your issue now

@PragJared
Copy link

I will checkout your sample project and see what I can find...keep you posted no worries

@mageweaver
Copy link
Owner

should have answer by tomorrow.

@mageweaver
Copy link
Owner

Yes

On Tue, Feb 23, 2016 at 9:13 AM, Benny Bottema notifications@github.com
wrote:

@artificialtrends https://github.com/artificialtrends are you still
maintaining this repo?


Reply to this email directly or view it on GitHub
#1 (comment)
.

@bbottema
Copy link
Contributor Author

@artificialtrends any update? It's a little annoying that when I forget an extra linefeed at the end that I get the vague "X is not a module." error

@mageweaver
Copy link
Owner

I am working on it...will have a fix by tomorrow.

On Mon, Feb 29, 2016 at 8:30 AM, Benny Bottema notifications@github.com
wrote:

Any update? It's a little annoying that when I forget an extra linefeed at
the end that I get the vague "X is not a module." error


Reply to this email directly or view it on GitHub
#1 (comment)
.

@bbottema
Copy link
Contributor Author

@artificialtrends, @PragJared. I'm sorry, but you need to work on your expectancy management skills.

7 days after question:

PragJared: I will checkout your sample project and see what I can find...keep you posted no worries
artificialtrends: should have answer by tomorrow.

4 Days later:

I am working on it...will have a fix by tomorrow.

14 days later: nothing.

Look it's ok if you can't handle the work load, but don't tell me you have an answer and a solution the next day. Do I need to fork this and fix it myself? I'll keep you posted, no worries

@bbottema
Copy link
Contributor Author

...

@ohjimijimijimi
Copy link

@bbottema Check the pull request. I think it will solve your issue.

@bbottema
Copy link
Contributor Author

bbottema commented May 22, 2016

@ohjimijimijimi, I moved on, sorry. angular/angular2-seed works better anyway.

@nikitadyumin
Copy link

hi, any updates? is either of the PR going to be merged?

@PragJared are you maintaining this repo?

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

5 participants