webpack.config.js 613 B

123456789101112131415161718192021222324252627
  1. const path = require('path');
  2. const webpack = require('webpack');
  3. module.exports = {
  4. entry: {
  5. sm2: './src/sm2/index.js',
  6. sm3: './src/sm3/index.js',
  7. sm4: './src/sm4/index.js',
  8. },
  9. output: {
  10. path: path.resolve(__dirname, 'dist'),
  11. filename: '[name].js',
  12. library: '[name]',
  13. libraryTarget: 'umd',
  14. },
  15. module: {
  16. loaders: [{
  17. test: /\.js$/,
  18. exclude: /node_modules/,
  19. loader: 'babel-loader'
  20. }]
  21. },
  22. plugins: [
  23. new webpack.optimize.UglifyJsPlugin(),
  24. ]
  25. };