ngs-template-pot2
v2.2.3
Published
NGS template for PoT
Downloads
2
Readme
ngs-template-pot
NGS template used in pot to build webapps.
It contains tasks for:
- build
- test
- serve
This version uses the following tools:
How to install
By default ngs will try to install it if the template is referenced in a package.json
.
But if you want to install it because you already know you'll need it:
ngs install [email protected]
Options
- uglify: boolean (default: true)
- cssSrcMap: boolean (to create source map files for CSS, default: false)
- copyStyleguide: string (the name of the styleguide package, default: null)
- copyHelp: boolean (to copy or not the help directory, default: false)
Tasks
copy
The copy task will copy to the dist:
- app/menu.json
- app/**/*.(png|jpg|jpeg|svg)
- assets/**
How to overwrite a configuration
You must create a ngsconfig.js
file at the root of your project like this:
module.exports = (name, config) => {
return {
uglify: false,
cssSrcMap: true,
copyStyleguide: sicpa-styleguide-dark
}
}
Proxy configuration
In the nsconfig.js
, you can override the proxy configuration and proxy multiple paths to a specific target like this:
module.exports = (name, config) => {
return {
serve: {
server: {
port: 3000,
},
proxy: [
{
path: '/api/',
target: 'http://host1:8080'
}
,
{
path: '/otherapi/',
target: 'http://host2:8088'
},
]
},
};
};
- The
path
option is used to match the start of the request URL - The full list of supported proxy server options can be found at https://github.com/nodejitsu/node-http-proxy#options
For each task that use some configuration, this method will be called.
Then the returned object (if exists) is merged with the default configuration.
If you don't return anything, the default values are kept.
If you need to filter which configuration you change, use the name
parameter.