Welcome to mirror list, hosted at ThFree Co, Russian Federation.

webpack.config.js - github.com/jbub/ghostwriter.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 67f1dd65fbbea9efac12fcf3e3707c692e28444a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const path = require('path');
const perfectionist = require('perfectionist');
const discardComments = require('postcss-discard-comments');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const FixStyleOnlyEntriesPlugin = require("webpack-fix-style-only-entries");
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');

module.exports = {
  entry: {
    site: path.join(__dirname, 'static', 'styles', 'site'),
    syntax: path.join(__dirname, 'static', 'styles', 'syntax'),
  },
  resolve: {
    modules: [
      'node_modules'
    ],
    extensions: ['.scss'],
  },
  output: {
    path: path.join(__dirname, 'static', 'dist'),
  },
  plugins: [
    new FixStyleOnlyEntriesPlugin(),
    new MiniCssExtractPlugin({
      filename: '[name].css'
    }),
    new OptimizeCssAssetsPlugin({
      cssProcessor: discardComments,
      canPrint: false
    }),
    new OptimizeCssAssetsPlugin({
      cssProcessor: perfectionist,
      cssProcessorOptions: {
        format: 'compact'
      },
      canPrint: false
    })
  ],
  module: {
    rules: [
      {
        test: /\.scss$/,
        use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
      }
    ]
  }
};