Opened 2 years ago
Last modified 14 months ago
#46099 assigned defect (bug)
Twenty Nineteen: Ignore theme based node_modules
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | minor | Version: | 5.0 |
Component: | Build/Test Tools | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
Recently, the Twenty Nineteen theme was moved from Github into Trac. Twenty Nineteen is the first theme that is using npm and therefore has a node_modules directory within the theme folder.
When running grunt
, grunt build
or grunt watch
multiple errors occur and the command gets aborted. While this could be bypassed using grunt --force
, grunt build --force
and grunt watch --force
, a better approach would be to ignore the theme based node_module folder.
Steps to reproduce
- Navigate to
/src/wp-content/themes/twentyninteen
- Run
npm install
- Navigate to
/
- Run
grunt
Expected result
- No error occurs.
Current result
- The following error occurs:
Running "jsvalidate:build" (jsvalidate) task ... ... ... Encountered 292 errors. Warning: Task "jsvalidate:build" failed. Use --force to continue. Aborted due to warnings.
Attachments (1)
Change History (6)
#2
follow-up:
โย 3
@
2 years ago
- Component changed from Bundled Theme to Build/Test Tools
Awesome, thank you @nielslange!
This works on my end, but I'd like for someone with some experience in that Gruntfile to take a closer look. Going to reassign this to the "Build/Test Tools" component for some more eyes there.
#3
in reply to:
โย 2
@
2 years ago
Youโre very welcome, @kjellr, and thanks for changing the component to Build/Test tools. Thatโs definitely a better component for this change. ๐
@allancole & @kjellr: Feel free to test my patch. ๐
PS: While I created this patch to solve the concrete issue I ran into while working on Twenty Nineteen related tickets, I created the patch in a way that it affects all themes that have a node_modules directory.
PPS: The quickest way to test this patch is by running
grunt jsvalidate:build
directly.