Skip to content

Commit

Permalink
Rewrite removing temp folder with clean-webpack-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dyuvzhenko committed Nov 13, 2017
1 parent a149be1 commit 74acb55
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
17 changes: 0 additions & 17 deletions webpack/clean-temp.js

This file was deleted.

16 changes: 10 additions & 6 deletions webpack/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
var path = require('path');
var webpack = require('webpack');

var cleanTemp = require('./clean-temp.js');
cleanTemp(path.join(__dirname, '../temp'));
var CleanWebpackPlugin = require('clean-webpack-plugin');

var packageJSON = require('../package.json');

Expand All @@ -23,19 +21,25 @@ switch (process.env.npm_lifecycle_event) {
break;
}

var _plugins = [];
var _plugins = [
new CleanWebpackPlugin('temp', {
root: path.join(__dirname, '..')
})
];
var _output = {};

if (ENV === 'development') {
_plugins = [new webpack.BannerPlugin(getBanner(false))];
_plugins = [..._plugins,
new webpack.BannerPlugin(getBanner(false))
];
_output = {
path: path.join(__dirname, '../temp'),
filename: '[name].js'
};
}

if (ENV === 'production') {
_plugins = [
_plugins = [..._plugins,
new webpack.BannerPlugin(getBanner(true)),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
Expand Down

0 comments on commit 74acb55

Please sign in to comment.