2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00
Files
Jeff ce6d3ea2cd - dont destroy /dist/ when building homepage
- update public path (should work this time!)
- load octicons from CDN
2018-01-15 15:52:31 -08:00

35 lines
962 B
JavaScript

// https://github.com/shelljs/shelljs
require('shelljs/global');
env.NODE_ENV = 'production';
var path = require('path');
var config = require('../config');
var ora = require('ora');
var webpack = require('webpack');
var utils = require('./utils');
var webpackConfig = utils.shouldBuildHomepage() ? require('./webpack.site.conf') : require('./webpack.prod.conf');
var text = utils.shouldBuildHomepage() ? 'homepage' : 'vue-select UMD module';
var spinner = ora(`building ${text}...`);
spinner.start();
var assetsPath = path.join(config.build.assetsRoot, config.build.assetsSubDirectory);
if (!utils.shouldBuildHomepage()) {
rm('-rf', assetsPath);
mkdir('-p', assetsPath);
}
/**
* Build the /dist/ folder
*/
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')
});