You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These settings deviate from the Angularity standard project structure
215
+
These additional settings may be used to deviate from Angularity's optinionated project structure.
197
216
198
217
```javascript
199
218
appDir :'./app', // your composition roots
@@ -203,20 +222,18 @@ releaseDir: './app-release', // output of the release build
203
222
testGlob :'**/*.spec.js'// identify your test files
204
223
```
205
224
206
-
#### Environment variables
225
+
###Bower
207
226
208
-
All options may be parsed from uppercase environment variables. Use a dot to delimit depth.
227
+
Bower packages may be imported like node modules but if there is a node module of the same name available then it will be used in preference.
209
228
210
-
For example, to **suppress warnings** during the build:
229
+
Inline loader statements (see shimming) cannot be used when requiring bower packages. If the package requires globals (such as jQuery) then then need to be set in the Angularity options.
230
+
231
+
### Shimming
232
+
233
+
If a package does not export anything, or requires some global, then it may be [shimmed](https://github.com/webpack/docs/wiki/shimming-modules) on an as-used basis.
234
+
235
+
Since the **Angular** package does not export anything it would normally require the `export-loader?angular` statement to be used. However this is already taken care of in the common configuration and you do not need to take further action.
@@ -238,22 +255,42 @@ The result of `angularity()` is an instance with a number of accessors - `app`,
238
255
239
256
### Resolving
240
257
241
-
While webpack-configurator provides methods for extensibility of the configuration it is not a valid webpack configuration until `configurator.resolve()` is called. This is done automatically by the `angularity.resolve()` method, negating the need to iterate over the configurator instance(s).
258
+
While [webpack-configurator](https://www.npmjs.com/package/webpack-configurator) provides methods for extensibility of the configuration it is not a valid webpack configuration until `configurator.resolve()` is called.
259
+
260
+
This is done automatically by the `angularity.resolve()` method, removing the need to iterate over the (possibly numerous) configurator instances.
// return a webpack-configurator or Array.<webpack-configurator>
248
-
// the .resolve() method will be called on each element returned
267
+
// the .resolve() method will be called on each element returned
249
268
});
250
269
```
251
270
252
271
### Operators
253
272
254
273
In order to create the configurators for each **mode**, a number of additional **operators** are added to `webpack-configurator`.
255
274
256
-
The default operators include:
275
+
You may add your own operator using the `extend()` method. Each operator is called with the current instance of the Configurator as `this` and should return the same or a new Configurator.
276
+
277
+
For example, to add the `foo` operator:
278
+
279
+
```javascript
280
+
module.exports=angularity(...)
281
+
.extend({
282
+
foo:functionfoo() {
283
+
returnthis
284
+
.merge({...}); // use the fluent webpack-configurator API
285
+
}
286
+
})
287
+
.resolve(function () {
288
+
returnthis.test
289
+
.foo(); // operators are available on any Configurator instances comming out of 'test'
290
+
})
291
+
```
292
+
293
+
There are a number of operators used internally. These include:
0 commit comments