-
Notifications
You must be signed in to change notification settings - Fork 2
usage
Run the scripts
that are defined in your package.json
by using npm run ...
.
For example:
-
run a single build using
npm run build
-
run a watch using
npm run watch
-
run release build using
npm run release
These scripts should have been created during project setup (package.json).
Refer to npm scripts for more information on this feature.
Bower packages may be imported like node modules. Requiring the full module will generate code that requires each bower main
element.
A vendor.js
file will be generated in your /app
directory if you have any Bower dependencies. If it is present it will not be overwritten so you will need to update it if you add further dependencies.
This file may be amended to fix any bad bower modules. Simply replace the statement the imports the whole package with individual import statements for its consituent files.
If there is a node module of the same name available then it should be used in preference but some edge cases exist. Best practice should ensure you do not have a module installed with the same name as your intended npm module. If a given module is not working as expected, build unminified and establish exactly where the module is comming from.
Inline loader statements (see shimming) cannot be used when requiring the bower package wholesale. If the package requires globals (such as jQuery) then then need to be set in the globals
option. Alternatively you can import the consituent files of the package one-by-one, in which case shimming will work.
You may ignore Bower completely, and simply use npm modules. However note that npm modules will be transpiled where Bower files are not.
In this case your vendor.js
file will be empty. It will still be included in the compilation so it is up to you whether you re-task it for other means.
If a package does not export anything, or requires some global, then it may be shimmed on an as-used basis.
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.
Running in test
mode will cause test.js
file to generated in the /app
directory. It will be composed of Bower devDependencies
along with all *.spec.js
files found in your project.
If it is present it will not be overwritten so you will need to manually add any new *.spec.js
files that you create thereafter.
A /app-test
directory will be created with a built test project. Karma should be configured to load vendor.js
and test.js
files in that order. For more information refer to karma-angularity-solution.
-
Getting started
-
Reference
-
How it works