-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem linking to assets. #740
Comments
cc: @OscarGodson @sebnitu |
Hi @dadambickford- you'll want to put your client side assets in the |
So if we had /assets/css/baseweb.css in our project we could access the file by hitting localhost:1337/css/baseweb.css? Or, if we had a file in /assets/baseweb.css it'd be localhost:1337/baseweb.css?Or, is it /public/*? Those all don't work. I just retried all of them. On all of our machines we just get |
@mikermcneil bump? :\ we're not having any luck and there's no |
All of the assets in Sails are handled by the Grunt process. So when Sails is lifted it's simply starting up the Grunt service by running See if you can run it from the command line and if it gives you any errors. That would be a good first step. grunt compileAssets That command should create the |
You can also see output from Grunt during the Sails lift process if your logging level is set to "verbose". You can change the logging level via your app's config/log.js file. |
@sgress454 There's no config/log.js file. I did some digging and I found where I put it. Looks like the config/application.js file. @particlebanana We get an error:
That shows up when running that command manually and in the verbose logging. I tried Am I missing something? |
Finally. I needed to install |
You need both. The issue with the missing |
I had this problem too, but noticed that I only had one line of code in each of the asset files that weren't showing up in the .tmp/public directory when I ran sails lift (I was just doing some testing) ... once I added more lines to the files they worked. Hope this helps |
also try (from the CLI) sails lift --dev should get rid of any cache issues |
This is working now so you can close this! |
Is there a reason you're injecting scripts in this way vs just using the grunt-contrib-requirejs plugin? |
@cameronjroe because we don't want to use Require or Grunt :) If you're a require user and want to use Grunt I'm sure that'd work fine. |
But you are using Grunt.. and are you not writing your scripts in amd? |
Nope, we're not using Grunt at all. Here's the Sails' Grunt file for our project: module.exports = function (grunt) {
// Keep here to make make Sails shut up
grunt.registerTask('default', []);
}; And the only reason that's there is because Sails requires at least a default task or it complains. We're using NPM + Browserify + Jake. We have Browserify just build different packages and require them async. |
Interesting. Browserify looks awesome. The current Gruntfile doesn't leave much room for customization out of the box. I'm basically killing most of it to substitute with the Requirejs plugin. :( |
We also commonly use compass which is actually part of the grunt-contrib suite. |
Having trouble linking to our css. We have tried putting it in different folders, linking to different levels of folders, using to input, etc. I'm sure it's something simple we're overlooking but as of now, we're stumped.
Thanks in advance.
The text was updated successfully, but these errors were encountered: