i have developed a small project for that i need to work with performance test and all,
which one is best for performance and development and testing server aswell in webpack or gulp to deploy the angular 2 app in iis, what is the major difference between gulp and webpack?
Is not that is good or better, but you don't need gulp.
Just use Angular CLI for development which uses webpack and if you need other build logic just add npm scripts.
Related
I have a project with 4 microservices in total, 3 in PHP and 1 in JS, in 1 monorepo. I love to use Prettier for both languages and I want to use ESLint for JS and CS Fixer for PHP to assure code quality. Right now I have a Prettier installation and configuration for each package.
/js1
/.eslintrc.json
/prettier.config.json
/js2
/.eslintrc.json
/prettier.config.json
/js3
/.eslintrc.json
/prettier.config.json
/php1
/prettier.config.json
For the JS packages theres quite some overlap in the configuration. However, there're also specific plugins or settings for Prettier per microservice. The same goes for ESLint for the JS microservices.
I'm thinking about how to
Run Prettier, ESlint and PHPfixer from the root of the project.
Share the configuration, but have microservice-specific config as well.
Optimally run the formatting and linting on staged files as well.
Every solution I found focusses on a frontend-only project and tools like Lerna are not maintained well.
I thought about the following approaches
Use NPM workspaces to install Prettier once on the root, but where do I install Prettier and where its Plugins?
Add Prettier / ESLint scripts to the root packages.json and run them with concurrently (package).
Have a base Prettier config for JS and PHP, extend them in the project directories.
I'm very unclear about what the best practice is, so please share articles, opinions or tools with me.
I have an electron app with 2 package.json files.
The root/package.json has all devDependencies, and the root/app/package.json has all dependencies which is necessary for app running.
So I package app folder using electron-packager, then build installer for windows using inno setup.
But when I install the app, because the node_modules in app has too many dependencies, the installer is so slow in order to extract all contents from node_modules.
Other apps cost 3-10s for installing, but mine 25-35s.
So what should I do for this? Maybe I can bundle the js using webpack before packaging?
Thanks.
You should absolutely use something like webpack (or equivalent) to bundle your application. Webpack does an excellent job at tree-shaking your dependencies and only keeping the resultant necessary modules.
I have already posted a possible solution for electron projects, including a build process approach that leads to installation building. My particular recommendation leaned on utilizing Wix for MSI deployment but the build process items are still applicable (steps 1-6) for anyone wanting to understand a possible process for the items important to doing this work (even if you use another installer). Hope this helps:
https://stackoverflow.com/a/46474978/3946706
Are you packaging a web app into electron? The slow packaging time is probably because of bundling web node modules into the electron app which is not necessary.
https://medium.com/#hellobharadwaj/electron-plus-angular-react-why-use-2-different-package-json-files-361ae47d07f3
I am new to yeoman. I want to use angular, grunt, sass, bootstrap for my project. Which is the best yeoman generator to use for this. It should have a good build mechanism/task.
I am in a study phase for an application development. The server-side development has already started, with Spring boot and Maven. Now, I am studying the possible options to develop the client-side.
I'd like to use Angular 2 (I know it's still in alpha), but I'm really hesitating between its javascript and typescript version. I know the live reload with javascript version should work well with maven spring-boot run (in theory), and this is a great help for productivity. I was wondering if there was a way to have the live reload for typescript version of Angular too. Has anyone managed to implement it in its own project? If yes, how did you do?
I have not found any doc about this on maven-typescript-plugin
The build system will be Maven for client side too.
EDIT: Is there an easy way for typescript debugging, or is it a pain?
One way could be adding a watch to automatically be triggered on any file change. For example, try adding the following to your package.json file:
{
"scripts": {
"tsc": "tsc -p src -w"
}
}
As the Quickstart for Angular 2 (literally) states that this will be activated when you open a terminal window in the root of the application folder and enter:
npm run tsc
The script sets the compiler watch option (-w) so the compiler stays alive when it's finished. It watches for changes to .ts files and recompiles them automatically.
Considering this will spit out plain-old .js files, you can use the tooling you're comfortable with to reload the page.
We have a TeamCity CI server that needs to be able to execute Jasmine 1.3 and Jasmine 2.0 tests (at different times, on different jobs). It is using the TeamCity Karma integration. My research so far is inconclusive, but it seems like Karma can only have one version of the Jasmine plugin at a time, so it's an either-or proposition. Another way to attack it would be to have two separate installs of Karma on the TeamCity server, but I'm a newbie at both TeamCity and Node, and not sure how this would work out. Any suggestions?
Thanks!
Karma looks for the karma-jasmine plugin in the local node_modules folder. The quickest way to switch versions is to simply replace the karma-jasmine folder with the version you want (automated or otherwise) before running your tests, but this has the potential to get messy.
Different installs of Karma is likely the cleaner way. There isn't any issue with having 2 (or as many as you like) local installs of Karma, since they all live under a node_modules folder. In an example directory structure like this, the Karma installation under 1.3 won't know anything about the Karma installation under 2.0.
/tests/
/1.3/
/node_modules/
/karma/
/karma-jasmine/
/2.0/
/node_modules/
/karma/
/karma-jasmine/
karma-cli, the module that lets you run karma in a command window from anywhere, however, is one that is installed globally and so has one installation.
If you ran karma start while in the 1.3 folder, karma-cli will execute the Karma under 1.3, which in turn will load the karma-jasmine under 1.3. The same applies when in the 2.0 folder. This gives you the option of maintaining versioned test dependencies.