webpackConfig.js 645 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. const webpack = require( 'webpack' );
  7. const getWebpackEs6Config = require( './webpackEs6Config' );
  8. module.exports = function getWebpackConfig( destinationPath, moduleName ) {
  9. const config = getWebpackEs6Config( destinationPath, moduleName );
  10. config.output.filename = 'ckeditor.js';
  11. config.plugins = [
  12. new webpack.optimize.UglifyJsPlugin()
  13. ];
  14. config.module.rules.push( {
  15. test: /\.js$/,
  16. loader: 'babel-loader',
  17. options: {
  18. presets: [
  19. 'es2015'
  20. ]
  21. }
  22. } );
  23. return config;
  24. };