class等..

 

  12_class



 

  01_字符串扩展



 

  02_数值扩展



 

  03_数组扩展






 

  04_对象扩展



 

  Title



'use strict'

require('./check-versions')()

process.env.NODE_ENV='production'

constora=require('ora')

constrm=require('rimraf')

constpath=require('path')

constchalk=require('chalk')

constwebpack=require('webpack')

constconfig=require('../config')

constwebpackConfig=require('./webpack.prod.conf')

constspinner=ora('building for production...')

spinner.start()

rm(path.join(config.build.assetsRoot,config.build.assetsSubDirectory),err=>{

if(err)throwerr

webpack(webpackConfig, (err,stats)=>{

spinner.stop()

if(err)throwerr

process.stdout.write(stats.toString({

colors:true,

modules:false,

children:false,//If you are using ts-loader, setting this to true will make TypeScript errors show up during build.

chunks:false,

chunkModules:false

})+'\n\n')

if(stats.hasErrors()) {

console.log(chalk.red('Build failed with errors.\n'))

process.exit(1)

    }

console.log(chalk.cyan('Build complete.\n'))

console.log(chalk.yellow(

'Tip: built files are meant to be served over an HTTP server.\n'+

'Opening index.html over file:// won\'t work.\n'

    ))

  })

})



'use strict'

constchalk=require('chalk')

constsemver=require('semver')

constpackageConfig=require('../package.json')

constshell=require('shelljs')

functionexec(cmd) {

returnrequire('child_process').execSync(cmd).toString().trim()

}

constversionRequirements=[

  {

name:'node',

currentVersion:semver.clean(process.version),

versionRequirement:packageConfig.engines.node

  }

]

if(shell.which('npm')) {

versionRequirements.push({

name:'npm',

currentVersion:exec('npm --version'),

versionRequirement:packageConfig.engines.npm

  })

}

module.exports=function() {

constwarnings=[]

for(leti=0; i

constmod=versionRequirements[i]

if(!semver.satisfies(mod.currentVersion,mod.versionRequirement)) {

warnings.push(mod.name+':'+

chalk.red(mod.currentVersion)+'should be'+

chalk.green(mod.versionRequirement)

      )

    }

  }

if(warnings.length) {

console.log('')

console.log(chalk.yellow('To use this template, you must update following to modules:'))

console.log()

for(leti=0; i

constwarning=warnings[i]

console.log(''+warning)

    }

console.log()

process.exit(1)

  }

}

你可能感兴趣的:(class等..)