all files / configs/component_export/ getMiniAppExportConfig.js

62.5% Statements 5/8
100% Branches 0/0
0% Functions 0/1
62.5% Lines 5/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20                             
 
 
var getMiniAppCommonConfig = require('../getMiniAppCommonConfig.js');
var merge = require('webpack-merge');
const CleanWebpackPlugin = require('clean-webpack-plugin')
var path = require('path');
 
module.exports = function (options) {
  let { type, root } = options;
  let outputPath = path.resolve(root, `dist/export/${type}`);
  return merge(getMiniAppCommonConfig(options), {
    output: {
      path: outputPath
    },
    plugins: [
      new CleanWebpackPlugin(['./*'], {root: outputPath, verbose: false})
    ]
  })
}