webpack.config.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. const MiniCssExtractPlugin = require("mini-css-extract-plugin")
  2. const path = require("path")
  3. const StyleLintPlugin = require('stylelint-webpack-plugin')
  4. const { ProvidePlugin } = require("webpack")
  5. module.exports = {
  6. cache: false,
  7. entry: "./misago/admin/src/index.js",
  8. output: {
  9. path: path.resolve(__dirname, "misago", "static", "misago", "admin"),
  10. filename: "index.js"
  11. },
  12. module: {
  13. rules: [
  14. {
  15. enforce: "pre",
  16. test: /\.js$/,
  17. exclude: /(node_modules)/,
  18. loader: 'eslint-loader'
  19. },
  20. {
  21. test: /\.js$/,
  22. exclude: /(node_modules)/,
  23. loader: 'babel-loader'
  24. },
  25. {
  26. test: /\.(sa|sc|c)ss$/,
  27. use: [
  28. MiniCssExtractPlugin.loader,
  29. "css-loader",
  30. {
  31. loader: "postcss-loader",
  32. options: {
  33. plugins: function() {
  34. return [
  35. require("autoprefixer")
  36. ]
  37. }
  38. }
  39. },
  40. "sass-loader"
  41. ]
  42. }
  43. ]
  44. },
  45. plugins: [
  46. new StyleLintPlugin({
  47. configFile: "./node_modules/stylelint-config-twbs-bootstrap/scss/index.js"
  48. }),
  49. new MiniCssExtractPlugin({
  50. filename: "index.css"
  51. })
  52. ]
  53. }