bower.json can specify which files should be ignored:
ignore [array]: An array of paths not needed in production that you want Bower to ignore when installing your package.
Which paths are ignored by default?
From the source:
json.ignore = mout.array.combine(json.ignore || [], [
'**/.*',
'node_modules',
'bower_components',
config.directory,
'test',
'tests'
]);
Apparently all dotfiles are ignored, as are the bower_components, node_modules, test, and tests directories. I don't know what config.directory is.
Update: I just published a package, and the test directory was not ignored. Apparently I've misunderstood the source code. I'd love clarification from a Bower contributor.
Files which are listed in ignore property will not be installed by bower.
So, if you have a this kind of structure:
style.css
index.html
bower.json
script.js
and a bower.json file:
{
"ignore": [ "./script.js" ]
}
script.js will not be installed within this component.
Related
On my ruby project when I try to run gulp (gulp server, gulp watch) I have the following error :
Users/workspace/website2019/gulpfile.babel.js:1
import del from 'del';
^^^^^^
SyntaxError: Cannot use import statement outside a module
I don't get how can I fix it, if someone could help me please,
you use babel transpilation with gulp because of the file gulpfile.babel.js For this reason you need to install babel. according to the documentation you need #babel/register and #babel/preset-env for transpiling your import syntax.
So run the following command in your project folder
npm install --save-dev #babel/core #babel/register
Afterwards create the babel configuration file .babelrc in the root folder and add the following lines to it
{
"presets": [
[
"#babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
}
make sure you have this line in package.json
"type": "module"
I am trying to use the generate_workspace on one of the project which has deps and transitive dependencies. Once thegenerate_workspace.bzl has been generated and I copied it to the WORKSPACE and followed the instruction in the bazel docs. Though I see the deps and their transitive deps listed in the generate_workspace.bzl my project during java_library phase is not able resolve transitive deps.. when I import the same project in IDEA I don't see the jars correctly loaded.
My doubt is for the deps I see the generate_workspace.bzl is adding its transitve deps as runtime_deps which means they are available only during runtenter code hereime
I have created gist of all the files here
https://gist.github.com/kameshsampath/8a4bdc8b22d85bbe3f243fa1b816e464
Ideally in my maven project I just need https://gist.github.com/kameshsampath/8a4bdc8b22d85bbe3f243fa1b816e464#file-src_main_build-L8-L9, though generate_workspace.bzl has resolved rightly i thought its enough if my src/main/BUILD looks like
java_binary(
name = "main",
srcs = glob(["java/**/*.java"]),
resources = glob(["resources/**"]),
main_class = "com.redhat.developers.DemoApplication",
# FIXME why I should import all the jars when they are transitive to spring boot starter
deps = [
"//third_party:org_springframework_boot_spring_boot_starter_actuator",
"//third_party:org_springframework_boot_spring_boot_starter_web",
],
)
But sadly that gives lots of compilation errors as transitive deps are not getting loaded as part the above declaration. eventually I have to define like how I did in the https://gist.github.com/kameshsampath/8a4bdc8b22d85bbe3f243fa1b816e464#file-src_main_build
src_main_build is BUILD file under package src/main/BUILD
third_party_BUILD is the BUILD under package third_party/BUILD
Bazel expects you to declare all your direct dependencies. I.e. if you directly use a class from jar A, you need to have it in your direct dependencies.
What you are looking for is a deploy jar. This is a bit hacky but you can actually do it that way (in third_party/BUILD):
java_binary(
name = "org_springframework_boot_spring_boot_starter_actuator_bin",
main_class = "not.important",
runtime_deps = [":org_springframework_boot_spring_boot_starter_actuator"], )
java_import(
name = "springframework_actuator",
jars = [":org_springframework_boot_spring_boot_starter_actuator_bin_deploy.jar"],
)
This will bundle all dependencies except the neverlink one in a jar (the _deploy.jar) and reexpose it.
An update: rules_jvm_external is the officially maintained ruleset by the Bazel team to fetch and resolve artifacts transitively.
You can find the example for Spring Boot here. The declaration in the WORKSPACE file looks something like this:
load("#rules_jvm_external//:defs.bzl", "maven_install")
maven_install(
artifacts = [
"org.hamcrest:hamcrest-library:1.3",
"org.springframework.boot:spring-boot-autoconfigure:2.1.3.RELEASE",
"org.springframework.boot:spring-boot-test-autoconfigure:2.1.3.RELEASE",
"org.springframework.boot:spring-boot-test:2.1.3.RELEASE",
"org.springframework.boot:spring-boot:2.1.3.RELEASE",
"org.springframework.boot:spring-boot-starter-web:2.1.3.RELEASE",
"org.springframework:spring-beans:5.1.5.RELEASE",
"org.springframework:spring-context:5.1.5.RELEASE",
"org.springframework:spring-test:5.1.5.RELEASE",
"org.springframework:spring-web:5.1.5.RELEASE",
],
repositories = [
"https://jcenter.bintray.com",
]
)
My issue is JSPM / SystemJS manually inserting CSS dependencies (namely Angular Material's CSS) when I have a different pipeline for those (Gulp + SASS).
How can I tell JSPM to not import CSS files or interpret CSS dependencies in any way? I found only this discussion - https://github.com/jspm/jspm-cli/issues/791 - but it did not help me at all.
Seems that JSPM prefers local package overrides rather than turning off CSS features completely.
The culprit of my original issue is Angular Material's package.json, which contains the following JSPM configuration:
"shim": {
"angular-material": {
"deps": [ "./angular-material.css!" ]
}
}
So what really solved my issue was to override that configuration:
jspm install angular-material -o '{ shim: {} }'
I would like to use https://github.com/MrRio/jsPDF in my ember project.
I wanted to import jsPDF as dependency, therefore I started this way:
bower install git#github.com:MrRio/jsPDF.git --save
Unfortunately, I cannot install files from plugins directory, because "plugins/*" directory is ignored in bower.json file.
I have tried overriding it this way, but without success.
"overrides": {
"jspdf": {
"ignore": [
"**/.*",
"libs",
"CNAME",
"jspdf.js",
"examples/jspdf.PLUGINTEMPLATE.js",
"todo.txt",
"wscript.py",
"build.sh",
"test",
"tools"
]
}
}
Could you please help me?
I just added a jsPDF plugins package to bower.
You can add all the plugins via
bower install jsPDF-plugins --save
In my module I have
-include("blah.hrl").
The .hrl file is not in the module's directory, but somewhere else on my system. How can I make rebar find it when compiling? Is there a way to add a path to the include directory in rebar.config?
{erl_opts, [{i, PathToIncludeFile}]}.
in rebar.config should do the thing. Or append {i, ...} to the existing erl_opts, if you have any.