discuss icon indicating copy to clipboard operation
discuss copied to clipboard

How to setup with Grunt

Open cringerjs opened this issue 7 years ago • 3 comments

Instructions have various different build tools but is lacking installation for Grunt. In normal ciircumstances I'd just switch to a different task runner but Grunt is the default task runner in Sails.js

I am using grunt-postcss and have gotten most postcss plugins to work just cant seem to get tailwind working.

This is the code from a blanket minimum application using grunt.

module.exports = function(grunt) {

  grunt.initConfig({
    postcss: {
      options: {
        processors: [
          require('tailwindcss')('./src/tailwind.js')
        ]
      },
      dist: {
        expand: true,
        cwd: './src',
        src: ['**/*.!(coffee|less)'],
        dest: 'dest'
      }
    } 
  });
  grunt.loadNpmTasks('grunt-postcss');
};

With this setup I'm getting the error.

Fatal error: C:\Users\Jeremy\Code\theattic\src\tailwind.js:49:21: Missed semicolon  47 |   'transparent': 'transparent',
  48 |
> 49 |   'black': '#22292f',
     |                     ^
  50 |   'grey-darkest': '#3d4852',
  51 |   'grey-darker': '#606f7b',

I thought maybe the require alone would import the information from the js files but changing src: ['**/*.!(coffee|less|js)'], but in this case just a blank .css file is created.

cringerjs avatar Oct 06 '18 09:10 cringerjs

That's really weird, looks like it thinks that comma in the config file is a syntax error? Can you double check you are on a recent version of Node? We transpile for Node 6.9.0+.

adamwathan avatar Oct 06 '18 16:10 adamwathan

Also what is does your source CSS file look like? Can you tell what is giving you the "Missed semicolon" error? I'm not sure if it's Node or something else, or if it's happening in a linter or something?

Saw a similar error in this other issue:

https://github.com/webpack-contrib/stylelint-webpack-plugin/issues/95

adamwathan avatar Oct 06 '18 16:10 adamwathan

@cringer Hey, were you able to resolve this error? Was it a wrong node version as @adamwathan mentioned at the time the target Node version(s) was 6.9.0+ ?

john-raymon avatar Jan 02 '20 23:01 john-raymon