#46099 closed defect (bug) (duplicate)
Twenty Nineteen: Ignore theme based node_modules
Reported by: | nielslange | Owned by: | nielslange |
---|---|---|---|
Milestone: | 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 (9)
#2
follow-up:
↓ 3
@
6 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
@
6 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. 😉
#4
@
6 years ago
- Milestone changed from Awaiting Review to Future Release
- Version changed from trunk to 5.0
#5
@
5 years ago
- Summary changed from Ignore theme based node_modules to Twenty Nineteen: Ignore theme based node_modules
@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.