webpack.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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-new"),
  10. filename: "index.js"
  11. },
  12. module: {
  13. rules: [
  14. {
  15. test: /\.js$/,
  16. exclude: /(node_modules)/,
  17. loader: 'babel-loader'
  18. },
  19. {
  20. test: /\.(sa|sc|c)ss$/,
  21. use: [
  22. MiniCssExtractPlugin.loader,
  23. "css-loader",
  24. {
  25. loader: "postcss-loader",
  26. options: {
  27. plugins: function() {
  28. return [
  29. require("autoprefixer")
  30. ]
  31. }
  32. }
  33. },
  34. "sass-loader"
  35. ]
  36. }
  37. ]
  38. },
  39. plugins: [
  40. new StyleLintPlugin({
  41. configFile: "./node_modules/stylelint-config-twbs-bootstrap/scss/index.js"
  42. }),
  43. new MiniCssExtractPlugin({
  44. filename: "index.css"
  45. })
  46. ]
  47. }