mirror of
				https://github.com/KevinMidboe/vue-chartjs.git
				synced 2025-10-29 18:00:20 +00:00 
			
		
		
		
	update webpack to version 3
This commit is contained in:
		| @@ -1,35 +1,41 @@ | ||||
| // https://github.com/shelljs/shelljs | ||||
| require('shelljs/global') | ||||
| env.NODE_ENV = 'production' | ||||
| 'use strict' | ||||
| require('./check-versions')() | ||||
|  | ||||
| var path = require('path') | ||||
| var config = require('../config') | ||||
| var ora = require('ora') | ||||
| var webpack = require('webpack') | ||||
| var webpackConfig = require('./webpack.prod.conf') | ||||
| process.env.NODE_ENV = 'production' | ||||
|  | ||||
| console.log( | ||||
|   '  Tip:\n' + | ||||
|   '  Built files are meant to be served over an HTTP server.\n' + | ||||
|   '  Opening index.html over file:// won\'t work.\n' | ||||
| ) | ||||
| const ora = require('ora') | ||||
| const rm = require('rimraf') | ||||
| const path = require('path') | ||||
| const chalk = require('chalk') | ||||
| const webpack = require('webpack') | ||||
| const config = require('../config') | ||||
| const webpackConfig = require('./webpack.prod.conf') | ||||
|  | ||||
| var spinner = ora('building UMD module...') | ||||
| const spinner = ora('building for production...') | ||||
| spinner.start() | ||||
|  | ||||
| var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory) | ||||
| rm('-rf', assetsPath) | ||||
| mkdir('-p', assetsPath) | ||||
|  | ||||
|  | ||||
| webpack(webpackConfig, function (err, stats) { | ||||
|   spinner.stop() | ||||
| rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { | ||||
|   if (err) throw err | ||||
|   process.stdout.write(stats.toString({ | ||||
|     colors: true, | ||||
|     modules: false, | ||||
|     children: false, | ||||
|     chunks: false, | ||||
|     chunkModules: false | ||||
|   }) + '\n') | ||||
|   webpack(webpackConfig, function (err, stats) { | ||||
|     spinner.stop() | ||||
|     if (err) throw err | ||||
|     process.stdout.write(stats.toString({ | ||||
|       colors: true, | ||||
|       modules: false, | ||||
|       children: false, | ||||
|       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' | ||||
|     )) | ||||
|   }) | ||||
| }) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user