edition-node-gulp | gulp wrapper around patternlab-node core | Frontend Framework library
kandi X-RAY | edition-node-gulp Summary
kandi X-RAY | edition-node-gulp Summary
The Gulp wrapper around Pattern Lab Node Core, the default PatternEngine, and supporting frontend assets.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Build the pattern
- renders from config
edition-node-gulp Key Features
edition-node-gulp Examples and Code Snippets
Community Discussions
Trending Discussions on edition-node-gulp
QUESTION
I have a patternlab implementation (edition-node-gulp). I'm trying to add selectize.js to it (https://github.com/selectize/selectize.js). When I add the indicated jquery function to the foot.mustache file, and check out the result, console indicates reference error: can't find variable $
(i.e. not recognizing jquery). When I add jquery.min.js to the head.mustache, above my selectize.js script tag, some of pattern lab's functionality stops working, some of it STARTS working, and I start getting different error messages (i.e. it now recognizes jquery). TypeError: $('#select-beast').selectize is not a function.
Here's head.mustache:
...ANSWER
Answered 2018-Feb-16 at 16:54Maintainer of Pattern Lab Node here.
In my opinion, your problem is your path.
Change it to
Because the way Pattern Lab outputs patterns, the base public/
directory is always two levels up. You'll notice the other files in that head pattern are going two levels up too.
public/
- patterns/
- pattern-name/file
- js/
QUESTION
I have a Pattern Lab edition-node-gulp set up and would like to use NPM to manage UI dependencies, like jQuery, D3 and others. Pattern Lab is set up so that development happens in a 'Source' folder, which is complied and moved to a 'Public' folder. The root of the Public folder becomes the root of the application when served.
Currently, I include assets like jQuery and others manually. I think it would be great to manage dependencies like jQuery right in the package.json file used to run all of Pattern Lab Node, but the node_modules folder exists outside of Public, so I can not reference it in the live application.
So far, it seems that I have two options:
- Continue as is, and forget package management for these assets.
- Create a second package.json inside Public with jQuery and others, which seems sloppy.
Is creating a second package.json so bad? Am I failing to consider some other option?
...ANSWER
Answered 2017-Dec-21 at 22:48Creating a second package.json is not that bad (when you know what and how you are doing of course). However in your particular case it is not the best scenario because there are way better options.
What is the problem? Adding the assets to the build output. So, what you can do:
- install the assets via
npm install
and save them in the original package.json - adapt
gulpfile.js
to copy the files in the output directory.
If the second step step is too hacky / problematic it could be also replaced with simple package.json scripts
change (add build
script):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install edition-node-gulp
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page