I have already created an npm repository in Nexus3. According to my scenario, I have a build command to run then it is created as a dist folder. Under this folder, I have .tgz file. I need to upload this .tgz file to Nexus. I set up my package.json file as follows,
"publishConfig": {
"registry": "http://localhost:8081/repository/npm-private/"
},
"bin": "./dist/apps/theme-builder-app/my-theme-builder-0.0.3.tgz"
my .npmrc file is also working correctly.
Then I ran the command npm publish. After that whole project was uploaded into the nexus except my files :(
Then I configured the .npmignore as follows,
*
!./dist/apps/theme-builder-app/bst-theme-builder-0.0.3.tgz
!*/bst-theme-builder-0.0.3.tgz
That also not working.
I have attached my folder structure below, and I figured out which file I want to upload to the nexus3.
Related
For my vite app, I'm looking to have multiple entry points. In this case, I moved my index.html into src/main. After building, I noticed that there are nested directories in my dist folder which is not what I wanted.
I've been reading the rollup docs to find the correct option to prevent this but no luck. Any ideas?
I had the same problem as you and after hours of searching this is how I solved it:
Create js file (build.js - or whatever name you want)
In this build.js file with some help from nodejs file system module(fs) you can modify structure of dist folder as you want.
Finally, modify package.json file to run build.js file after vite build command, for example: "build": "vue-tsc --noEmit && vite build --mode=production && node PATH_TO_YOUR_BUILD_JS_FILE"
I have node.js app. I installed pkg to create executable file that can be run on any platform. I use pkg . command for it. The problem is I have few csv files and config.json file where I store all of my settings. They are all in /settings/ folder. The problem is that they are not included in the pkg package and I get error after trying to run it. I tried to add
"assets": [
"settings/*",
"settings/**/*"
]
into package.json file but it didn't work. How can I add all files that are in the /settings/ folder so they are also included in the executive file without any errors?
I am creating a typescript library, and when I am bundling it with parcel.js, the package.json file is not getting copied into the dist folder. Can any one let me know how can it be done?
You could accomplish this by using the copyfiles package and modifying your build script to copy the package.json file to the dist folder after parcel runs. (e.g. parcel build && copyfiles package.json dist).
However, the reason why parcel doesn't support this out of the box is that you probably don't want to do this. When you're making and publishing an npm library, there are a number of fields in your package.json that have special meaning - especially "main", but also "types" and "module". When you publish your library, you want to make sure that these fields point to the right thing.
When you run parcel build, parcel looks at these these fields in your package.json to decide where to put the output files.
So if you then copied your unmodified package.json file to the dist folder and tried to publish the dist folder as if it were your package, things would be broken for your users - the package.json's main field would point to dist/outputbundle.js, but the actual file would be at /bundleoutput.js.
If you want publish only a subset of the files in your project, the typical way to do this is to use the package.json files field to "whitelist" which folders get included when you run npm publish, without modifying the package structure (see docs).
Set up a react app with create-react-app.
Everything works fine.
Problem:
On vscode, the git tab is always showing hundreds of json files modification and creation on the folder node_modules/.cache/babel-loader.
This did not happen on my previous projects.
I've tried reinstalling babel with no results.
Deleting the files does nothing.
files in the folder look as fallows: 0aab1329ff345c34fe844d530b69ce5d.json
If you only see created files, then you should just add node_modules to your .gitignore file. If you see modified files, then you have already committed these to source control. You should remove them with git rm and still add node_modules to .gitignore.
How do i get my app to read .js and .css files after npm install?
What i did was:
npm install bootstrap#3
After which, the bootstrap folder goes into my node_modules folder. /node_modules/bootstrap I followed through with compiling the css and js files using grunt:
grunt dist
and it creates a dist folder in /node_modules/bootstrap/.
What i did now was to move the dist folder from "/node_modules/bootstrap/" into my public folder "/www" so i can include it into my page located in my public folder "/www/index.html"
But somehow this feels wrong and I'm not sure if i'm going the right way.
Looking around for some resource but just can't get much information. Anyone can provide a solution or direct me to some right resource so that i can find out more. Thanks.
I think you're actually doing fine, since bootstrap is only based on those .css & .js files.