embark/site/source/docs/pipeline_and_webpack.md

25 lines
1.3 KiB
Markdown
Raw Normal View History

fix(plugins/basic-pipeline): ensure correct webpack config is loaded When making `basic-pipeline` in https://github.com/embarklabs/embark/commit/948956ab1f7fde154e4a4a36c58cfa677ecff9c6 we've introduced a regression and with this fix, a behaviour change as well:: 1. The `webpackConfigName` passed to `Engine` is completely ignored, caused it to be `undefined` down the line when the plugin tries to do its work (we essentially broke bundling) 2. With that configuration being ignored, we need a new way to make this configurable. Since `basic-pipeline` is now a true plugin, it makes sense for itself to have configuration options for that, while still providing decent defaults. 3. The trickly thing is that `webpackConfigName` used to have different values per command. For example `build` used to use `production` while `run` used `development` as config. 4. This commit introduces new configuration options for `basic-pipeline` that lets users configure the `webpackConfigName` per environment: ```json // embark.json { ... "plugins": { "embark-basic-pipeline": { "development": { webpackConfigName: "development" }, "production": { webpackConfigName: "production" } } } } ``` ^ These are also the defaults. So not providing this configuration will make Embark imply it. Notice that this does not account for the "different config per command" case. This means `embark build` will also use `development` by default. Prior to this commit and the one mentioned above, the `webpackConfigName` was configurable through the CMD `--pipeline` option. Since this a) no longer a built-in feature and b) ignored at the moment anyways, I've removed the `--pipeline` options from all commands as well. BREAKING CHANGES The commands `embark eject-webpack` and `embark eject-build-config` are no longer available. The `--pipeline` option has been removed from all commands that used to support it.
2020-03-18 11:49:56 +01:00
title: Building with Embark
2019-04-18 12:33:52 +02:00
layout: docs
---
As discussed in [Running Apps](running_apps.html#Using-the-run-command), Embark takes care of quite a few things developing applications, including compiling Smart Contracts, JavaScript and other assets. In this guide we'll learn how to take full advantage of Embark's flexibility to build our Smart Contracts or even replace the entire build pipeline for our application's assets.
## Building your app
Embark's `build` command enables us to build our decentralized application and deploy it accordingly. Similar to `embark run`, it compiles our Smart Contracts, deploys them to a blockchain network that our app is connected to, processes our app's assets and uploads them to the configured decentralized storage (e.g. IPFS).
By default, `embark build` will use the `production` mode to build our application.
```
$ embark build
```
## Compiling Smart Contracts only
If we're building a [Smart Contract only application](http://localhost:4000/docs/create_project.html#Creating-%E2%80%9Ccontracts-only%E2%80%9D-apps), or we're simply not interested in building the entire application and deploying it, but just want to compile our Smart Contracts, we can use the `build` command's `--contracts` option:
```
$ embark build --contracts
```