Skip to content

Double inclusion of referenced files #50

Open
@Valve

Description

@Valve

Assuming I have application.js with

//= require dependency1.js.ts
//= require file1.js.ts
//= require file2.js.ts

And file1.js.ts is:

/// <reference path="dependency1.js.ts" />
class File1 {}

And file2.js.ts is:

/// <reference path="dependency1.js.ts" />
class File2 {}

When I do asset compilation I end up with dependency1 being included 3 times into the resulting file.
First time it's from application.js inclusion, second and third is from file1.js.ts and file2.js.ts respectively.

As far as I can tell this happens because of: https://github.com/typescript-ruby/typescript-rails#referenced-typescript-dependencies

Questions:

  1. Is it possible to include a dependency once? I want asset-pipeline handle this (because we have a big project where everything is setup using asset pipeline).
  2. If not, how can I change the inclusion/walking process? Should I use tsconfig.json for this or something else?

Thanks for your help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions