In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you what is the use of Dojo Build, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Dojo provides a powerful set of command-line tools that make it easier to build modern applications.
You can create packages (Bundle) automatically, you can use PWA to cache files locally, you can render the initial HTML and CSS during the build phase, or you can use Dojo's CLI tool and .dojorc configuration file to conditionally ignore some code. Or eject away from the Dojo build tool and directly use the underlying build tool to achieve full control.
Functional description Dojo CLI modular command-line tools for quickly launching new applications, creating widgets, running tests, and so on. A local web server used when the development server is developed to listen to the file system and automatically rebuild when a change is detected. HTTPS and setting up proxies are also supported. Bundle improves the user experience by reducing the content that users need to download and optimizing the application interaction time (Time-to-Interactive) that users actually need. Packages can be created automatically based on routes, or packages can be explicitly defined in the configuration file. Conditional inclusion code through the .dojorc configuration file, you can statically turn off or turn on functions defined using dojo/has. Branches of code that cannot be accessed because of these configurations are automatically ignored. This makes it easy to provide specific functionality for specific targets, such as IE11 or mobile, without affecting the size of the package. PWA enables progressive Web applications to create a faster and more reliable user experience by caching content or even working offline. Through a configuration file or defined in code, dojo can easily create a service work and build it as part of the application. Render at build time renders routes at build time to generate the initial HTML and CSS. When rendering at build time, Dojo saves the cost of initial rendering and creates a more responsive application without introducing additional complexity. Basic usage
Dojo provides a set of CLI commands to assist in creating and building applications. This guide assumes that @ dojo/cli is installed globally and that @ dojo/cli-build-app and @ dojo/cli-test-intern are installed in the project. If the project was initialized with @ dojo/cli-create-app, these dependencies should already exist.
Construction
Dojo's CLI tool supports multiple build targets or mode. You can see all the patterns in several scripts (scripts) generated by dojo create app for package.json.
Run the following command to create a build optimized for the production environment.
> dojo build-- mode dist
This build uses the dist pattern to create the application package and outputs the results to the output/dist directory.
Running services and listening for Chan
When running in dev or dist mode, you can start a web server with the-- serve flag. The application runs on port 9999 by default. You can use the-- port flag to modify the port. Using the-- watch flag, Dojo's build tool can also listen for changes to the application and automatically rebuild.
The generated package.json file contains the dev script that uses these tags to run the build version of the application and listens to automatically rebuild when the file on disk changes.
> dojo build-mode dev-watch file-serve
The application also provides source map. This allows the debugger to map the built JavaScript code back to the original TypeScript code that is located in the src/ folder.
test
Dojo uses Intern to run unit and functional tests.
The fastest way to run unit tests in tests/unit is to use the NPM script created when you create a new Dojo application.
Command Lin
# browsers supported by execute unit testsnpm run test:unit# execute functional tests locally using headless Chrome and Seleniumnpm run test:functional
Dojo is a framework that is constantly evolving. By default, the released version of dojo supports the last two versions of the latest browser. For Dojo to implement standard functionality across browsers, the required polyfill is provided on demand through @ dojo/framework/shim. To support IE11, you need to open the-- legacy tag.
Dojo configuration
Additional configuration options can be added to .dojorc. These options typically extend available settings from the command line and support more advanced features such as internationalization, code split, PWA manifest, and ignore code.
The .dojorc file contains a JSON object that can be configured for any command that can be run on the dojo command line tool. Assign a node to each command in the configuration object, where you can store configuration information.
{"build-app": {"pwa": {"manifest": {"name": "My Application", "description": "My amazing application"}}, "test-intern": {}, "create-widget": {"tests": "tests/unit"}}
In this example, the three CLI command modules @ dojo/cli-build-app, @ dojo/cli-test-intern, and @ dojo/cli-create-widget correspond to one node each. The configuration is always hierarchical, in the order command = > feature = > configuration.
The above is all the content of this article "what's the use of Dojo Build?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.