Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. const ExtractTextPlugin = require('extract-text-webpack-plugin');
  2. const webpack = require('webpack');
  3.  
  4. module.exports = {
  5. entry: {
  6. global: ['./src/assets/js/global.js', './src/assets/js/anotherfile.js'],
  7. i18n: ['./src/lib/js/i18n.js'],
  8. css: ['./src/assets/scss/screen.scss']
  9. },
  10. output: {
  11. filename: 'app/assets/js/[name].bundle.js'
  12. },
  13. module: {
  14. rules: [
  15. {
  16. test: /\.js$/,
  17. loader: 'babel-loader',
  18. exclude: [/node_modules/],
  19. query: {
  20. presets: ['es2015']
  21. }
  22. },
  23. { // css / sass / scss loader for webpack
  24. test: /\.(css|sass|scss)$/,
  25. use: ExtractTextPlugin.extract({
  26. use: ['css-loader', 'sass-loader'],
  27. })
  28. }
  29. ]
  30. },
  31. plugins: [
  32. new webpack.optimize.CommonsChunkPlugin({
  33. name: 'vendor'
  34. }),
  35. new ExtractTextPlugin({ // define where to save the file
  36. filename: 'app/assets/css/[name].bundle.css',
  37. allChunks: true,
  38. }),
  39. ],
  40. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement