Front-end project packaging tools
$ npm install nte-cli --g
nte-cli init | i [create initialize your project config]
nte-cli build | b [integration of resources, inject dependency, compress code]
nte-cli upload | u [upload static assets to CDN]
nte-cli publish | p [push html file into the CMS template]
{
encoding: 'UTF-8',
entry: '*.html', // or an array exp: ['./a.html', './module/b.html', './11/*.html']
output: {
cdnPath: '',
clean: true, // whether remove existing file in dist folder, before each building
dir: {
root: 'dist',
image: 'images',
js: 'js',
css: 'css',
others: 'assets'
},
cssFile: 'head~[hash].css',
jsFile: 'foot~[hash].js',
},
svnRoot: 'd:/frontend', // setting svn root dir for compatible with absolute paths of previous projects
log: false,
image: {
base64: 1024 // less than 1024 byte, would convert to base64 url
},
upload: { // add item of "otppwd: ******" in outer network environment
username: '',
password: '',
path: '',
includeHtml: false,
exclude: []
},
api: {}
}
const nte_cli = require('nte-cli')
const paramConfig = require('./nte.config')
Object.assign(paramConfig.upload, {
cwd: '../dist/js/test.js',
path: 'f2e/test'
})
nte_cli.upload(paramConfig)
- support dynamic dependence and router
- fix bug: remove js file of unnecessary built [dist.js]
- optimize output formation of uploaded CDN url
- support for module invocation
- upgrade the dependent library (uglify-js | commander)