Grails 3, access to node_modules

Launching the Grails 3 application and using the node plugin. My custom javascript is under grails-app/assets/javascripts, but when I run gradle build, it sets a folder node_modulesin my project root directory. This folder contains all my JS libraries, and I cannot access them from my version grails-app/assets/javascripts.

Is there any way to install node_modulesunder grails-app? Do I need to specify a directory in mine build.gradle?

Here are my node and grunt plugins in mine build.gradle.

classpath "com.moowork.gradle:gradle-node-plugin:0.12" classpath "com.moowork.gradle:gradle-grunt-plugin:0.12"

apply plugin:"com.moowork.node" apply plugin:"com.moowork.grunt"

+4
source share
1 answer

You can change the location of the node_modules folder.

First upgrade node and grunt plugins to version 0.13

classpath "com.moowork.gradle:gradle-node-plugin:0.13"
classpath "com.moowork.gradle:gradle-grunt-plugin:0.13"

-, build.gradle :

node { nodeModulesDir = file("grails-app") }

node_modules grails-app (.. grails-app/node_modules)

+1

Source: https://habr.com/ru/post/1675631/


All Articles