From d9ec50f859057e5bdaf0d366cb3d9bab782efa61 Mon Sep 17 00:00:00 2001 From: Daniel Kaspo Date: Mon, 12 Jun 2017 20:20:52 -0400 Subject: [PATCH] Use `fs` library so even Windows users can run build. --- webpack_config/webpack.prod.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/webpack_config/webpack.prod.js b/webpack_config/webpack.prod.js index d25a4db0..f11a6b99 100644 --- a/webpack_config/webpack.prod.js +++ b/webpack_config/webpack.prod.js @@ -1,16 +1,19 @@ 'use strict' process.env.NODE_ENV = 'production' -const exec = require('child_process').execSync const webpack = require('webpack') const ExtractTextPlugin = require('extract-text-webpack-plugin') const ProgressPlugin = require('webpack/lib/ProgressPlugin') // const OfflinePlugin = require('offline-plugin') const base = require('./webpack.base') const config = require('./config') +const fs = require('fs') +const distFolder = 'dist/'; -exec('rm -rf dist/') +if (fs.existsSync(distFolder)) + fs.rmdirSync(distFolder) + base.devtool = 'cheap-source-map' base.module.loaders.push( {