You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

webpack.config.js 983B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. var path = require("path");
  2. var ExtractTextPlugin = require("extract-text-webpack-plugin");
  3. var webpack = require("webpack");
  4. module.exports = {
  5. entry: {
  6. app: './js/main.js'
  7. },
  8. module: {
  9. rules: [
  10. {
  11. test: /\.js$/,
  12. exclude: /node_modules/,
  13. use: {
  14. loader: 'babel-loader',
  15. options: {
  16. presets: ['env']
  17. // plugins: [require('babel-plugin-transform-object-rest-spread')]
  18. }
  19. }
  20. },
  21. {
  22. test: /\.css$/,
  23. use: ExtractTextPlugin.extract({
  24. fallback: "style-loader",
  25. use: 'css-loader?importLoaders=1!postcss-loader'
  26. })
  27. }
  28. ]
  29. },
  30. output: {
  31. path: path.join(__dirname, "./../static/dist"),
  32. filename: '[name].bundle.js',
  33. },
  34. resolve: {
  35. modules: [path.resolve(__dirname, 'src'), 'node_modules'],
  36. },
  37. plugins: [
  38. new ExtractTextPlugin("main.css"),
  39. new webpack.ProvidePlugin({
  40. $: "jquery",
  41. jQuery: "jquery"
  42. })
  43. ],
  44. watchOptions: {
  45. watch: true
  46. }
  47. }