![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
gocept.recipe.bowerstaticbundler
Advanced tools
Minifies and bundles JS and CSS files included with bowerstatic.
Bundling and minifying components included via bowerstatic_.
This recipe imports you bowerstatic components, which you must specify in the
recipes config (see below for details). It then retrieves your local components,
calculates the import order and minifies and bundles JS and CSS files. The
bundles are saved to your bower_components
folder (or whatever folder you
specified) as a new component called bowerstatic_bundle
.
In your application you can then switch between bundled or non-bundled versions with an include helper function::
def bower_include(environ, name):
if not os.environ.get('BOWERSTATIC_DEBUG'):
name = 'bowerstatic_bundle'
include = components.includer(environ)
include(name)
In your view, where you normally get the includer and include your libraries, you now call::
bower_include(self.request.environ, '<you_library_name>')
This package uses rcssmin_ and rjsmin_ to minify CSS and JS files.
Here is an example configuration for bowerstaticbundler
::
[buildout]
parts += bundle
[bundle]
recipe = gocept.recipe.bowerstaticbundler
eggs = mypackage
myotherpackage
modules = mypackage.browser.resource
myotherpackage.browser.resource
bower = mypackage.bower
target_dir = ${config:bower_components}
environment = bundle-config
[bundle-config]
BOWER_COMPONENTS_DIR = ${config:bower_components}
You need to specify the location of your local components via the eggs
and
modules
options. Eggs is needed to import your modules, where the components
live, while modules specify the path to import them directly. This is needed as
bower calculates the components and resources during import time, so we need to
trigger them in the build step.
You also must provide the location of you bower singleton via the bower
option.
target_dir
specifies the directory, where the bundled component will be
placed. It is recommended to point this to your bower_components
folder, where
your bower packages live, as bowerstatic_ will have to import the bundles as
well in order to be able to include them into your Application.
With the environment
option you can specify environment variables. In the
example above we specify one environment variable called
BOWER_COMPONENTS_DIR
, which is the variable bower is looking for in the
environment to get the installed bower packages. This might be different in your
setup.
.. _bowerstatic: http://bowerstatic.readthedocs.org/ .. _rcssmin: http://opensource.perlig.de/rcssmin/ .. _rjsmin: http://opensource.perlig.de/rjsmin/
Also copy images into the bundle dir, which will be rendered as the fav icon.
Make generated .bower.json file more readable by adding newlines and indent.
When copying resources, create a separate directory for each package to reduce probability of name clashes.
bowerstatic_bundle
directory is missing.Fixed handling of the pkg_resources
working set when collecting
resources from eggs.
Make sure recipe does not brake when there are no resources to bundle.
FAQs
Minifies and bundles JS and CSS files included with bowerstatic.
We found that gocept.recipe.bowerstaticbundler demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.