Skip to content

Allow me to specify exactly which paths to load #1818

Closed
@kirahowe

Description

@kirahowe

Our webpacker config appears to be loading all of our test files and helpers for production builds. I need to exclude any files that end with .spec.ts now because since upgrading to rails 5.2.1 dev dependencies are no longer installed, which breaks the build since the spec files are looking for dev dependencies which aren't there. I do need to include any that end with just .ts, though (which are in the same directories as the ones with spec.ts, per angular community guidelines).

I see that webpacker automatically globs directories passed to resolved_paths, so I can't specify my own path there (i.e. the path I really want is app/assets/angular/**/*[^spec].ts, not just app/assets/angular/**/*). I also tried adding [^spec].ts to the extensions list, hoping webpacker would generate a path like app/assets/angular/**/*[^spec].ts, but it does not.

How do I tell webpacker to load only .ts files in app/assets/angular that do not end with spec.ts?

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