ember-cli watch file changes in subdirectories of the styles folder - ember.js

I started using EmberJS and ember-cli for a new project. Therefore I created a new project with ember-cli and added broccoli-compass with sass support. When I execute "ember server" in the terminal, ember is just watching for file changes on /app/styles/app.scss. I want ember-cli to also reload on file changes in subdirectories of the /app/styles folder (e.g. /app/styles/helpers/breakpoints.scss). How can I configure ember-cli for this purpose?

I just tried making a helpers directory and watchme.scss, and it sucessfully watches for changes, I suggest update your ember-cli version via npm update ember-cli. Here's the output:
file changed styles/helpers/watchme.scss
Build successful - 157ms.

Related

How to use ember sass in ember addon and correctly implement it into ember project

The following problem needs to be solved: I try to create a component within an ember addon, that's using sass. Within my addon I don't want to compile that scss files, that should be done within my project using ember-cli-sass and ember-css-modules-sass. The component I'm creating in my addon is also using sass modules, but I didn't install the ember packages for this, because I do that in my project.
I run into the problem, that when I try to serve my ember application from my project directory, I get the error that within my addon an imported scss file is unreadable or not there.
What am I doing wrong?
Thank you very much!
Add the Sass files to /app/styles/, not /addon/styles. This way they will be merged with the host app.

Intellij with ember error: "you have to be inside an ember-cli project in order to use build command"

I have created a project which is configured to use ember-cli on the webapp folder before launching the resulting code, however I get that error when the ember compiler is called.
Here are some pictures:
[picture1]
[picture2]2
Here is the project folder. I have done ember init on the webapp folder:
enter image description here
Is it something related to ember or is it something related to my run configuration?
This is duplicated. As I mention in another your post, you should run ember init in that folder. You don't have ember project structure yet

ember folder contains only gitkeep file

after creating a folder in ember I see nothing but a file called ".gitkeep" in all the folders such as routes and templates(in every folder). This problem seems to be repeating after trying to install many times..
.gitkeep files are here to force git to commit the directory. By default git do not version folder and an ember-cli project is by default a git repository. (unless you specified --skip-git).
A new ember-cli project should contain at least app/templates/application.hbs because this is all you need to start.
You can add routes and controllers with ember generate route and ember generate controller.

how do i add vendor javascript to ember-cli 2.2

This might be a silly question stemming from unfamiliarity. I'm rewriting a project that was previously using Ember 1.7 in Ember 2.3, using Ember-cli v2.2
Now, in the old project, there were a couple of libraries being included manually on the index.html file, put in the scripts directory and then compiled. For example, let's say the JS asset I want to include is offline.js.
I understand that Ember-cli uses Bower and can be used to install bower components, like Bootstrap or moment.js and such. What about custom JS? I've put the file in offline.js, included it in index.html but that doesn't do anything.
I don't think I understand how to add/import vendor assets at all; how do add, say offline.js to the project and have it available throughout the application?
You should add the offline.js file to the vendor folder at the root of the project, and then in your ember-cli-build.js file add the following line:
app.import('vendor/offline.js');
This adds the offline.js file to the vendor.js which is built by default. You can see more documentation at the Ember CLI website.

How do you import a newly created ember addon?

I'm trying to create my first Ember AddOn and I'm getting stuck importing it into an Ember project. I've created the addon and published to github like this:
ember-cli$ ember addon test-addon
ember-cli$ cd test-addon
ember-cli/test-addon$ git remote add origin <github-url>
Then, from my project, I install the addon:
test-app$ ember install <github-url>
And, lastly, try to import it into a route:
# app/rotues/index.coffee
import TestAddon from 'test-addon'
But, I'm getting this error on the console:
Uncaught Error: Could not find module `test-addon` imported from `test-app/routes/index`
Any ideas where I'm going wrong? I can see the addon in the node_modules directory but not in bower_components. I think(tm) this is my issue but I'm not sure what else I need to do to setup my addon.
tl;dr
cd my-addon
npm link
cd /my/project/dir
npm link my-addon
ember g my-addon # run default blueprint
Then add "my-addon": "*" to the devDependencies section of your app's package.json and restart the ember-cli app server.
Longer Answer
The easiest way to include a locally-developed addon is to use NPM's link
First run npm link from the root of your addon project to register it with npm. Then running npm link <your-addon-name> will have the same effect as npm installing it.
You'll still need to manually add it to your package.json (required for ember-cli to find it when compiling your app) and run the default blueprint (if your addon has one).
If this doesn't seem to be working, check that you've created a package.json in your addon with "ember-addon" in the keywords list (the default ember-cli addon blueprint should do this for you).