webpack.config.js 725 B

123456789101112131415161718192021222324252627282930313233
  1. var webpack = require('webpack');
  2. var ExtractTextPlugin = require('extract-text-webpack-plugin');
  3. var autoprefixer = require('autoprefixer');
  4. module.exports = {
  5. entry: './src/js/aos.js',
  6. output: {
  7. path: './dist',
  8. publicPath: 'dist/',
  9. filename: 'aos.js',
  10. library: 'AOS',
  11. libraryTarget: 'umd',
  12. },
  13. devServer: {
  14. contentBase: 'demo/'
  15. },
  16. module: {
  17. loaders: [
  18. {
  19. test: /\.js$/,
  20. loader: 'babel-loader'
  21. },
  22. {
  23. test: /\.scss$/,
  24. loader: ExtractTextPlugin.extract("style-loader", "css-loader?sourceMap!sass-loader!postcss-loader")
  25. }
  26. ]
  27. },
  28. plugins: [
  29. new ExtractTextPlugin('aos.css'),
  30. new webpack.optimize.UglifyJsPlugin()
  31. ]
  32. }