Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Webpack Includes Tests in Production Build #501

Closed
@nicwillemse

Description

@nicwillemse

In the current setup it looks as if the webpack configuration is including the JS specs as part of the production build.

Activity

SteveSandersonMS

SteveSandersonMS commented on Dec 13, 2016

@SteveSandersonMS
Member

Does it really include them? I just tried webpack --env.prod and looked at the resulting wwwroot/dist/main-client.js. Ctrl+F for "karma" and "should" both gave zero results, so it doesn't look like any test code is in there.

If you have repro steps that cause the tests to be included in production build, can you please post them?

nicwillemse

nicwillemse commented on Dec 14, 2016

@nicwillemse
Author

Hi @SteveSandersonMS,

I was referring to the actual tests themselves, since the webpack configuration does not seem to be excluding specs at all ?

MarkPieszak

MarkPieszak commented on Dec 14, 2016

@MarkPieszak
Contributor

@nicwillemse Do you mean that the webpack configs need the exclude portion for .spec.ts files added in there?

SteveSandersonMS

SteveSandersonMS commented on Dec 14, 2016

@SteveSandersonMS
Member

@nicwillemse Unless I'm missing something, the spec files don't need to be excluded. They won't be bundled with the application code, because the application code doesn't reference the specs.

nicwillemse

nicwillemse commented on Dec 15, 2016

@nicwillemse
Author

@MarkPieszak thats exactly what im saying. @SteveSandersonMS do you agree with this comment ?

SteveSandersonMS

SteveSandersonMS commented on Dec 15, 2016

@SteveSandersonMS
Member

No I don't - please see my previous comment for details :)

nicwillemse

nicwillemse commented on Dec 15, 2016

@nicwillemse
Author

@SteveSandersonMS - im not sure your previous comment applies, the specs will be bundled due to the webpack configuration.

SteveSandersonMS

SteveSandersonMS commented on Dec 15, 2016

@SteveSandersonMS
Member

Can you confirm that you're actually seeing spec code inside the built bundles in wwwroot/dist/?

I searched mine and didn't find any spec code in those bundles, nor would I expect to, since the specs are not referenced from the application code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

        Participants

        @nicwillemse@SteveSandersonMS@MarkPieszak

        Issue actions

          Webpack Includes Tests in Production Build · Issue #501 · aspnet/JavaScriptServices