Skip to content

"npm run build" should never broke a build #190

Description

@maxceem

At the moment when we build the app using "npm run build" the resulting built is broken. This happens because building script is concatenating the source code into a single file, and removes new lines, which can lead to the situations, when some code became broken because of the concatenation.

See issue we had:

the issue was because of using self-called function pattern https://github.com/topcoder-platform/admin-app/blob/dev/src/components/track-icon/track-icon.directive.js#L20
We already had such a code, but in the challenge second directive was added. So when they are merged into a single file, without ; compiler misunderstand our intention, and is trying to call some code which is not a function, because it sees (...) after it. (edited)

image

image

For now, to fix such issue we added ; manually in the directive files, see for example:

We have fix the building script so the source code doesn't get broken after modification, even if don't add ; in the source code in such places.

To test the build we can host dist folder using any static files server, for example:

npm run build
cd dist
npx http-server

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions