node-lessify icon indicating copy to clipboard operation
node-lessify copied to clipboard

@-webkit-keyframes

Open mrft opened this issue 9 years ago • 8 comments

Trying to require a css file starting with @-webkit-keyframes fails with the following error:

ParseError: Unexpected character '@'

Is this a bug, or does someone know of any workarounds to get this working?

mrft avatar Dec 21 '15 15:12 mrft

Does it normally work with command-line lessify? Usually that error means node-lessify isn't in the correct place in the package.json

wilson428 avatar Dec 21 '15 15:12 wilson428

What do you mean by command-line lessify?

(Also the css file is not mine, it is a part of an npm module, ngDialog.)

mrft avatar Dec 21 '15 16:12 mrft

Could you point me to the file please?

On Mon, Dec 21, 2015 at 11:09 AM, mrft [email protected] wrote:

What do you mean by command-line lessify?

(Also the css file is not mine, it is a part of an npm module, ngDialog.)

— Reply to this email directly or view it on GitHub https://github.com/wilson428/node-lessify/issues/22#issuecomment-166344114 .

[email protected] 434.242.9728

wilson428 avatar Dec 21 '15 16:12 wilson428

https://github.com/likeastore/ngDialog/blob/master/css/ngDialog.css

I installed it through npm then

require( 'ng-dialog/css/ngDialog.css' )

mrft avatar Dec 21 '15 16:12 mrft

This doesn't give me any trouble when I browserify it in my environment, so I suspect your package.json doesn't have node-lessify in the right place. Here's an example:

{
  "name": "demo",
  "version": "0.0.0",
  "description": "",
  "repository": {},
  "dependencies": {
    "browserify": "^10.2.0",
    "node-csvify": "~0.0.2",
    "node-lessify": "0.0.10",
    "node-underscorify": "~0.0.12",
  },
  "scripts": {},
  "browserify": {
    "transform": [
      "node-lessify",
      "node-underscorify",
      "node-csvify"
    ]
  }
}

wilson428 avatar Dec 21 '15 16:12 wilson428

Oops,

sorry my bad

Seems the setup wasn't correct on this project (was convinced I had require'd other css files already).

mrft avatar Dec 21 '15 16:12 mrft

Hmm, I closed this a bit prematurely.

This is my command:

browserify -t node-lessify -t stringify web/js/app/index.js -o web/browserified/app.js

which is run from an npm script (so I would typically call npm run somejob), but from the command-line I have the same problem.

I copied the css directory from node_modules/ng-dialog to folder-of-the-indexjs-file-of-some-sub-module-of-this-project.

Then when i replace

require( 'ng-dialog/css/ngDialog.css' )
with a relative path like so
require( './css/ngDialog.css' )
it all works as expected.

So, either this is a bug, or I am trying to use node-lessify in a way it wasn't meant to be used.

So I still don't understand what I am doing wrong, and when you say "This doesn't give me any trouble when I browserify it in my environment", did you do exactly the same as I did?

mrft avatar Dec 22 '15 09:12 mrft

Judging from the way you're using the require statement, it seems like this might be an issue with your Browserify config.

Enabling the fullPaths option would probably help!

DXCanas avatar May 12 '17 18:05 DXCanas