all files / configs/ getWebBuildConfig.js

54.55% Statements 6/11
0% Branches 0/2
0% Functions 0/1
54.55% Lines 6/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26                                        
var path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin')
var getWebCommonConfig = require('./getWebCommonConfig.js');
var getWebExportConfig = require('./component_export/getWebExportConfig_new');
 
var merge = require('webpack-merge')
 
 
module.exports = function (options) {
  if (options.media === 'export') {
    return getWebExportConfig(options);
  }
  var outputPath = path.resolve(options.root, 'dist/web');
  var buildConfig = {
    output: {
      path: outputPath
    },
    plugins: [
      new CleanWebpackPlugin(['./*'], {root: outputPath, verbose: false})
    ]
  }
 
 
  return merge(getWebCommonConfig(options), buildConfig)
}