In production site I can see individual js files rather than the concatenated file application JavaScript and CSS files. First I run the command grunt build and the output is
$ grunt build
Running "env:dev" (env) task
Running "sass:dist" (sass) task
Running "less:dist" (less) task
Running "jshint:all" (jshint) task
>> 272 files lint free.
Running "ngAnnotate:production" (ngAnnotate) task
>> 1 file successfully generated.
Running "uglify:production" (uglify) task
>> 1 file created.
Running "cssmin:combine" (cssmin) task
>> 1 file created. 193.41 kB → 144.31 kB
Done, without errors.
This command create 3 files in dist folder and I also removed public/dist folder from .gitignore. My public folder contains dist folder but after restarting production with pm2, results are still same. It is not loading files from dist folder
pm2 restart 0 --env production
[My MeanJS App][1]
Related
I am developing a new moodle plugin. But when I run grunt in my plugin folder
grunt amd.
directory structure
local->webcam->amd
amd has two folder build and src and my file is in src folder
I am getting following error
PS C:\xampp\htdocs\moodle\local\webcam> grunt amd
Running "ignorefiles" task
Running "eslint:amd" (eslint) task
Could not find any files to validate
I have no idea why it is not detecting my file.
My node version is correct and everything but grunt is not detecting my file
So I have a react with SSR project that I am trying to create a CI/CD pipeline. My project needs to deploy the following artifacts:
dist folder created by Webpack
appspec.yml file needed by Code Deploy
script folder for scripts that are references in appspec.yml
When I tried to get the files one by one using this buildspec.yml:
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
commands:
- npm install
build:
commands:
- npm run build
artifacts:
files:
- 'dist/*'
- 'appspec.yml'
- 'deploy-scripts'
I got dist with only part of it's content and the appspec.yml and the deploy scripts folder.
Then I tried a different approach:
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
commands:
- npm install
build:
commands:
- npm run build
artifacts:
files:
- '**/*'
base-directory: "dist"
discard-paths: yes
The dist folder has the scripts and the appspec file inside it. Now it does deploy, but I lose the folder structure of dist which is necessary for my deploy scripts.
I need to get all the contents of dist in their folder structure. As well as the scripts and the appspec.yml file. The scripts and the appspec.yml can't be inside dist, but dist needs to have all of it's content.
Can anyone help with this?
The solution was to use the first buildspec file and adding "**/*" to the dist directory.
So in the dist line it ends up being this: "dist/**/*".
So if we apply this to the general context, anytime you want to get a directory to be sent along with single files in the build phase, you can add it like this:
"[directory_name]/**/*"
And that will get you both the directory and everything inside it in a recursive way.
I am running grunt server after a clean install of Yeoman, using the Webapp generator and I get the following error:
Warning: Errno::ENOENT on line 441 of /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/pathname.rb: No such file or directory - /Users/nfento/Sites/test/app/bower_components
Run with --trace to see the full backtrace Use --force to continue.
Any idea what would be causing this? I have been able to reproduce the error on two machines. I'm completely new to using grunt, but have used it as a server with livereload previously.
Maybe is a bit late but:
check if you have a app/bower_components folder
if not check if there is a bower_components folder in the root
if it exists move it in the /app folder
create a file .bowerrcand paste this in:
{"directory": "app/bower_components"}
I'm building a shell script that does a gradle build and then run my grunt build after it is done and I'm storing this shell script in a subdirectory but the the graddle wrapper is in the root directory of the file. My shell script looks like this
sh .././gradle ../build.gradle clean build
grunt build
So when I call the script from the root directory it looks like this
$ sh gradle fullbuild
It errors out saying that
Execution failed for task ':fullbuild'. > Process 'command 'sh'' finished with non-zero exit value 127
When I do the first command from the script in the sub directory it says
FAILURE: Could not determine which tasks to execute. * What went wrong: Task '../build.gradle' not found in root project 'tools'.
Can I call gradle from a subdirectory and use that directories build.gradle file?
With the -b flag you can indicate which build file to use. Try
sh ../gradle -b ../build.gradle clean build
You could also specify the -p flag instead which indicates which directory is the project dir.
I have an application that can be built in one of 2 configurations (Company1 or Company2) and in debug or release mode.
Company1 Release
All builds done with the Release compiler flag
Build and output core dll files to build directory
Build and output Company1Plugin.dll to build directory
Copy tools\templates\log4net.config to build directory
Copy tools\templates\Company1.MyApp.exe.config to build directory
Company1 Debug
All builds done with the Debug compiler flag
Build and output core dll files to build directory
Build and output Company1Plugin.dll to build directory
Build and output MyApp.Debug.dll to build directory
Copy tools\Growl\log4net.GrowlAppender to build directory
Copy tools\templates\debug.log4net.config to build directory
Copy tools\templates\debug.Company1.MyApp.exe.config to build directory
Company2 Release
All builds done with the Release compiler flag
Build and output core dll files to build directory
Build and output Company2Plugin.dll to build directory
Build and output PrintingUtility.dll to build directory
Copy tools\templates\log4net.config to build directory
Copy tools\templates\Company2.MyApp.exe.config to build directory
Company2 Debug
All builds done with the Debug compiler flag
Build and output core dll files to build directory
Build and output Company2Plugin.dll to build directory
Build and output PrintingUtility.dll to build directory
Build and output MyApp.Debug.dll to build directory
Copy tools\Growl\log4net.GrowlAppender to build directory
Copy tools\templates\debug.log4net.config to build directory
Copy tools\templates\debug.Company2.MyApp.exe.config to build directory
I'm at a bit of a loss how to best model this matrix of dependencies in my rake file.
I would like to be able to simply do:
rake company1 #(release is the default)
rake company1 release
rake company2 debug
but cant quite figure out how to do this.
Obviously I have a build_and_output_core task that everything depends on, but then what? I can have the company1 and company2 tasks simply set some variables as to what should be done but then what triggers the actual copy activity?
I'm just getting started with both rake and ruby so any general advice is appreciated.
I would make two namespaces with the same code in, like the following code. If the number of companies grows beyond 10 companies I would start consider not making namespaces.
def do_stuff(company, mode)
# do stuff
end
namespace :company1 do
task :build_debug do
do_stuff("company1", :debug)
end
task :build_release do
do_stuff("company1", :release)
end
task :bd => :build_debug
task :br => :build_release
end #namespace company1
namespace :company2 do
task :build_debug do
do_stuff("company2", :debug)
end
task :build_release do
do_stuff("company2", :release)
end
task :bd => :build_debug
task :br => :build_release
end #namespace company2