Why does building a library using Vue CLI cause an error? - vue.js

Immediately after creating the application (without making any changes), I start building the library, according to the official documentation: https://cli.vuejs.org/guide/build-targets.html#app
npm run build --target lib --name myLib 'src/components/HelloWorld.vue'
As a result, I get the following error: Entry module not found: Error: Can't resolve 'C:\domains\vue-hello-world\lib' in 'C:\domains\vue-hello-world'
I also tried to build the library with this command:
vue-cli-service build --target lib --name myLib 'src/components/HelloWorld.vue'
And got another error:

Related

Extract single Component (with dependencies) from nuxt (2)

Is it possible to build single component libraries from a nuxt project like you do with vue-cli-service build --mode production --target lib ... in vue?
I installed vue-cli-service as dev-dependency (into my nuxt project) and ran:
vue-cli-service build --mode production --target lib --name <lib-name> </path/to/Component>
If I run it without any additional configuration, the build failed with:
Error: Compiling RuleSet failed: Unexpected property test in condition (at ruleSet[1].rules[1].resource.test: resource => {
currentResource = resource
return true

Error when building Kogito native images with Persistence profile enabled (quarkus-infinispan-client extension) witn ubi8 images

While trying to build a simple Kogito application with the Persistence profile enabled the build failed complaining that the lib stdc++ was not found:
/usr/bin/ld: cannot find -lstdc++
The builder image is based on the ubi8-minimal and to build it the s2i tool was used with the following command was used:
s2i build https://github.com/kiegroup/kogito-examples --context-dir jbpm-quarkus-example quay.io/kiegroup/kogito-quarkus-ubi8-s2i:0.8.0-rc1 kogitotest:10.0 --runtime-image quay.io/kiegroup/kogito-quarkus-ubi8:0.8.0-rc1 --loglevel 5 --env MAVEN_MIRROR_URL=http://nexus.apps.spolti.cloud/nexus/content/groups/public/ --env NATIVE=true --env MAVEN_ARGS_APPEND="-Ppersistence"
As first hint I think it could be something related with the libstdc++-static because when running the same build on my local machine it works and the only difference I found around this the stdc++ lib was that my machine have the llibstdc++-devel and static packages while the image only have the libstdc++, tried the to install the devel one, but no luck thus I thought it could be something related with the static one.
The fix:
To solve this I had to symlink /usr/lib64/libstdc++.so.6.0.25 to /usr/lib64/libstdc++.so
but not sure why on my machine it works without the symlink and have piratically the same libs available, eg libstdc++.so.6.0.27 with a symlink to libstdc++.so.6
Proper fix:
Just install gcc-c++ package.

Add files to dist when building library using vue-cli

I want to add a folder with some JSON files within the dist folder when building my own library using vue-cli.
I run the following command to build the library:
vue-cli-service build --target lib src/index.js.
I have tried to add the folder within the public folder, but it doesn't work when building library.
Is there a way to achieve it?
Thanks
You can use cp command
vue-cli-service build --target lib src/index.js && cp -R public/* dist

Which are the differences between vue-cli and vue-cli-service?

I've used Vue for some time now, but I'm just getting started with the CLI and I got a bit confused.
I installed #vue/cli and if I type vue in the command line, I get:
Usage: vue <command> [options]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
create [options] <app-name> create a new project powered by vue-cli-service
add [options] <plugin> [pluginOptions] install a plugin and invoke its generator in an already created project
invoke [options] <plugin> [pluginOptions] invoke the generator of a plugin in an already created project
inspect [options] [paths...] inspect the webpack config in a project with vue-cli-service
serve [options] [entry] serve a .js or .vue file in development mode with zero config
build [options] [entry] build a .js or .vue file in production mode with zero config
ui [options] start and open the vue-cli ui
init [options] <template> <app-name> generate a project from a remote template (legacy API, requires #vue/cli-init)
config [options] [value] inspect and modify the config
upgrade [semverLevel] upgrade vue cli service / plugins (default semverLevel: minor)
info print debugging information about your environment
Run vue <command> --help for detailed usage of given command.
I created a project with vue and I needed to install #vue/cli-service-global for some reason that I can't remember.
After that, however, I noticed:
'vue-cli-service' is not recognized as an internal or external command
And that's because I had to install #vue/cli-service. Now, when I type vue-cli-service in the command line, I get:
Usage: vue-cli-service <command> [options]
Commands:
serve start development server
build build for production
inspect inspect internal webpack config
run vue-cli-service help [command] for usage of a specific command.
Apparently, I can build, serve, and inspect with both CLI tools. My question is - what's the difference between them? Both the readme of #vue/cli and #vue/cli-service have nothing but a link to this page where no answer is given to that question.
What can I do with one that I can't do with the other? Do I need both?
#vue/cli-service-global is a package that allows you to run vue serve and vue build without any local dependencies.
#vue/cli-service is a package that actually doing those vue serve and vue build, both #vue/cli-service-global and #vue/cli depend on it.
If you're using #vue/cli then you don't need to install another two independently, since it already has #vue/cli-service in its dependencies.
Added: Just to be sure, I'll explain it more:
#vue/cli:
add, create, config, ui and other commands
build and serve commands through #vue/cli-service-global package
inspect command through #vue/cli-service package (local dependency)
#vue/cli-service-global:
build, inspect and serve commands through #vue/cli-service package
#vue/cli-service:
build, inspect and serve commands
So, you need to install #vue/cli only and remove other two.
Added: Clarification about using vue-cli-service:
When you create a project using vue create command, #vue/cli makes a link to vue-cli-service binary inside ./node_modules/.bin of created project.
Then you can use it like this:
Access it directly as vue-cli-service inside npm scripts (package.json):
"scripts": {
"watch": "vue-cli-service build --watch"
}
Access it from the shell: ./node_modules/.bin/vue-cli-service build --watch.
You can even add ./node_modules/.bin to you shell PATH and access it from the shell directly as vue-cli-service.

Distributed tensorflow fails with "BUILD file not found on package"

When attempting to build in the core/distributed_runtime module using:
$ bazel build -c opt
//tensorflow/core/distributed_runtime/rpc:grpc_tensorflow_server
We get the following error:
ERROR: error loading package 'tensorflow/core/distributed_runtime/rpc':
Extension file not found. Unable to load package for
'//google/protobuf:protobuf.bzl': BUILD file not found on package path.
INFO: Elapsed time: 0.097s
Are there additional steps required (and not mentioned in the README.md) ?
This sounds like a git submodule issue—and it would affect building any part of TensorFlow from source. To recover, run the following command in your git repository:
$ git submodule update --init --recursive
(There are many other ways to do the same thing: see this question for some suggestions.)