Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 300003

Themes should not crash when .info file appears inside node_modules

$
0
0

Using Grunt or Gulp is becoming a standard practice in Drupal theming. Both these approaches tend to install node js modules into a theme's folder to automate front-end tasks. After using $npm install, you end up with your node modules installed in this folder.

mytheme/node_modules

Certain Node modules have tests that include .info files in them. This conflicts with Drupal looking for the theme's .info folder.

In the browser you get: "No data sent" error message.

When using Drush for any command you get an mysterious error

Segmentation fault: 11

The following node/gulp/grunt modules all cause this problem. And they all happen to be very awesome tools for theming.

  • gulp-kss
  • grunt-kss
  • npm-kss
  • browser-sync > v1.0

There is a work around documented at https://www.drupal.org/node/2309023 which requires you install all your modules inside a folder starting with a period.

mytheme/.npm/node_modules

But this is a pain as your automated task all need to be re-written, and you need to run them from this folder which is non-standard (for all the themes I've seen using front-end tools like gulp or grunt). Also I think this a bit hacktacular as just works because the theme layer doesn't look in folders with a dot on the front.

As far as I know you can't easy tell nodejs to install to a folder starting with a period. (and I'm not an expert so if there is an easy way to do this please post it here)

Feature Request

Option 1 - Allow a way to exclude folders from searching for .info files.
Option 2 - If Drupal finds one that isn't in the correct drupal standard, ignore it.


Viewing all articles
Browse latest Browse all 300003

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>