Giter Club home page Giter Club logo

Comments (5)

calvinl avatar calvinl commented on July 28, 2024

It looks like you just have to change the dest option in your development targetment to point at appDir instead of tmpDir.

tmpDir is used for production only, because the concatenated files are moved to a temporary directory first, before minification/uglification. However, in the development target, we leave them un-minified so it's more readable.

You can see on https://github.com/calvinl/ng-phonegap/blob/development/Gruntfile.js#190 line 190 that the development target is pointed directly at appDir.

Let me know if that works for you!

from ng-phonegap.

calvinl avatar calvinl commented on July 28, 2024

p.s. Not necessary, but i would recommend adding your sass target separately from the LESS target, rather than replacing it -- that way you can easily switch back and forth when you want/need to.

from ng-phonegap.

stinoga avatar stinoga commented on July 28, 2024

Yeah, I tried that actually. When I make a change to an scss file after pointing the dest option to appDir, I still get no compiled CSS file. Wondering if the clean is wiping it out?

>> File "src/scss/main.scss" changed.
Running "clean:css" (clean) task
Cleaning "www/css"...OK

from ng-phonegap.

calvinl avatar calvinl commented on July 28, 2024

Your sass task is misconfigured then. Try something like this:

// compile SASS files into CSS and store them in temp directories
sass: {
  production: {
    files: [
      {
        src: ['<%= srcDir %>/**/*.scss', '<%= srcDir %>/!**/_*.scss'],
        cwd: 'scss',
        dest: '<%= tmpDir %>/css/app.css',
        ext: '.css',
        expand: true
      }
    ],
    options: {
      style: 'expanded',
      compass: true
    }
  },
  development: {
    files: {
      // put app.css directly into the build directory for development
      "<%= appDir %>/css/app.css": [
        "<%= srcDir %>/css/**/*.scss"
      ]
    },
    options: {
      style: 'expanded',
      compass: true
    }
  }
},

Notice the the different style -- you can get more specific using the style you were using, but at least now you know it's just a misconfiguration. I'd suggest reading the docs for grunt-contrib-sass to get a handle on how it works.

You'll also need to install grunt-contrib-compass since you have compass: true in your options.

from ng-phonegap.

stinoga avatar stinoga commented on July 28, 2024

Ah, the problem was the cwd property. It was causing the path to be set relative to a path that didn't exist. This fixed the problem:

development: {
  options: {
    style: 'expanded',
    compass: true
  },
  files: [
    {
      expand: true,
      src: ['**/*.scss', '!**/_*.scss'],
      cwd: '<%= srcDir %>/scss',
      dest: '<%= appDir %>/css',
      ext: '.css'
    }
  ]
}

Thanks for the help Calvin!

from ng-phonegap.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.