-
Notifications
You must be signed in to change notification settings - Fork 2
configuration
/* global process:true */
var angularity = require('webpack-angularity-solution');
const PORT = 55555,
GLOBALS = {
$ : 'jquery',
jQuery : 'jquery',
'window.jQuery': 'jquery'
};
module.exports = angularity({globals: GLOBALS, port: PORT}, process.env)
.include(process.env.MODE) // app|test|release
.otherwise('app_test') // run app+test if MODE is unspecified
.resolve();
Some explanation:
-
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