Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dojo/cli-build-webpack

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dojo/cli-build-webpack

build a dojo 2 application

  • 2.0.0-beta2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
33
increased by450%
Maintainers
1
Weekly downloads
 
Created
Source

@dojo/cli-build

Build Status codecov npm version

The official dojo 2 build command.

WARNING This is beta software. While we do not anticipate significant changes to the API at this stage, we may feel the need to do so. This is not yet production ready, so you should use at your own risk.

Usage

To use @dojo/cli-build in a single project, install the package:

npm install @dojo/cli-build-webpack

to use @dojo/cli-build in every project, install the project globally:

npm install -g @dojo/cli-build-webpack

Features

@dojo/cli-build-webpack is an optional command for the @dojo/cli.

Building

To build a Dojo 2 application for publishing:

dojo build webpack

This command will output the built files to the dist directory. After running this command, you can open the dist/index.html file to see your application.

You can also build in watch mode, which will automatically rebuild your application when it changes:

dojo build webpack -w

@dojo/cli-build-webpack can be customized further. Use the help option to see everything you can do:

dojo build webpack --help

Building a custom element

@dojo/cli-build-webpack can also build custom web elements as per the custom web v1 specification. Custom elements are built by providing the name of a custom element descriptor.

dojo build webpack --element=src/path/to/createTheSpecialElement.ts

This will output a dist/the-special directory containing:

  • the-special.js - JavaScript file containing code specific to the TheSpecial widget.
  • widget-core.js - JavaScript file containing shared widget code. This is separated to allow for better caching by the browser.
  • the-special.css - CSS relating to the TheSpecial widget.
  • the-special.html - HTML import file that will import all the scripts and styles needed to use the element.

If the source file does not follow the pattern create[custom element]Element, @dojo/cli-build-webpack cannot determine what the name of the custom element should be. In this case, you can specify the --elementPrefix option to explicitly name the element.

dojo build webpack --element=src/path/to/element.ts --elementPrefix=the-special

Eject

Ejecting @dojo/cli-build-webpack will produce a config/build-webpack/webpack.config.js file. You can run build using webpack with:

node_modules/.bin/webpack --config=config/build-webpack/webpack.config.js

How do I contribute?

We appreciate your interest! Please see the Dojo 2 Meta Repository for the Contributing Guidelines and Style Guide.

Installation

To start working with this package, clone the repository and run npm install.

In order to build the project run grunt dev or grunt dist.

Testing

Test cases MUST be written using Intern using the Object test interface and Assert assertion interface.

90% branch coverage MUST be provided for all code submitted to this repository, as reported by istanbul’s combined coverage results for all supported platforms.

To test locally in node run:

grunt test

Licensing information

© 2017 JS Foundation. New BSD license.

FAQs

Package last updated on 20 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc