-
Notifications
You must be signed in to change notification settings - Fork 2
configuration
A pro-forma configuration was provided in the project setup. We will now discuss its general form.
var angularity = require('webpack-angularity-solution');
module.exports = angularity(...options|factoryFn)
.include([modes])
.otherwise([defaultModes])
.resolve();
The webpack-angularity-solution
is based on webpack-multi-configurator. As such it has a number of defined builds that we will call modes.
The available modes include:
-
app
Builds compositions into
/app-build
directory. -
release
Builds compositions into
/app-release
directory. Externalised chunk manifiest and embeds intoindex.html
. -
test
Generates a
/app/test.js
test suite composed of all.spec.js
files. Builds test suite into/app-test
directory.
-
Option
globals
Note that there are no globals in applications bundled by Webpack. If your code relies on globals such as jQuery, you will have to configure the
globals
option as shown above.Add additional globals as required by your application.
Better practice may be to solve the problem at its source using module Shimming (see Shimming below).
-
Option
port
By default
--watch
in theapp
mode will launch a BrowserSync server on port55555
. You should override this port to some unique value so that your projects to no conflict with each other. -
Options by
process.env
More than one configuration may be passed to
angularity()
. This meansprocess.env
may be passed in entirity (See environment variables below). -
The
include()
andotherwise()
methodsThe
include()
statement runs either of the definedapp
|test
|release
compilations where theMODE
environment variable.Omission of
MODE
implies theotherwise()
behavior, where bothapp
andtest
compilations will run. You should customise this default behavior to your taste.The
test
mode is only meaningful if you have*.spec.js
files in your project.
-
Getting started
-
Reference
-
How it works