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

ace.js in bower.json #43

Open
dpfellner opened this issue Apr 24, 2014 · 3 comments
Open

ace.js in bower.json #43

dpfellner opened this issue Apr 24, 2014 · 3 comments
Labels

Comments

@dpfellner
Copy link

I'm working on learning AngularJS and associated workflow using the Yeoman generator-angular to scaffold the basic seed project. I'm evaluating a couple embeddable editors and installed ui-ace via Bower:

bower install angular-ui-ace -S

This properly installs everything to bower_components and adds ui-ace.js as a dependency in bower.json:

{
  ...
  "angular-ui-ace": "~0.1.1"
}

Which in turn adds the script to index.html on grunt:

<script src="bower_components/angular-ui-ace/ui-ace.js"></script>

The issue is ace.js (which is required) is not added as a dependency on install:

<script type="text/javascript" src="bower_components/ace-builds/src-min-noconflict/ace.js"></script>

Does anyone know the proper syntax to add it as a dependency in bower.json so it is included in my build?

@Mavlarn
Copy link

Mavlarn commented Aug 22, 2014

The file '.bower.json' in ace-builds doesn't contain a main property, so bower can not know which file to inject. You can add "main": "./src-min-noconflict/ace.js" in that file, then it can be injected.
But the proper way is to let ace-builds project to modify.

@richleland
Copy link

We had to deal with this issue as well and it's more than just adding the ace.js file to the ace-builds project's bower.json file. The underlying ace-builds actually comprise of many files - extensions, themes, modes, etc. This is likely going to need to be customized on a per-project basis. We handled this by using wiredep, which uses an overrides property in our bower.json like so:

"overrides": {
    "ace-builds": {
      "main": [
        "src-min-noconflict/ace.js",
        "src-min-noconflict/mode-html.js",
        "src-min-noconflict/mode-handlebars.js",
        "src-min-noconflict/mode-json.js",
        "src-min-noconflict/theme-eclipse.js"
      ]
    }
}

Note this method is not finalized in the bower spec per bower/spec#27.

I do agree the ace-builds project needs to modified regardless - it should at least set main to ace.js, includes everything in the ace-builds repo (50MB), and I can't see a bower.json file anywhere in their project, but that's another story.

@yoshiokatsuneo
Copy link

+1 for adding ui-ace.js and ace.js to main in the bower.son.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants