Skip to content

Does not work with build systems #1

@anxolerd

Description

@anxolerd

Description

I tried to create a project using jacss and used webpack as a build system. However, I have encountered some problems with that. JACSS suddenly became unavailable.

Steps to reproduce

Project structure

+ jacss/
    + jacss.main.js
    + scripts/
        + jacss.js
        + jacss-speech.js
        + jacss-....js
+ static/

jacss.main.js

require('scripts/jacss.js')
require('scripts/jacss-speech.js')
...

etc

Webpack has jacss.main.js as entry point.
HTML pages use bundle, built with webpack

Expected result

JACSS works correctly

Actual result

JACSS is not working, an error appeared in the console: jacss is not defined

Suggestions

I suggest that happens because build system wraps js files into anonymous functions. Thus jacss is not available in global scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions