aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/config/webpack/common.js
blob: 1ef193c7f468ab8a2b1d1c21de2937b6117211e7 (plain) (blame)
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
const path = require('path');
const webpack = require('webpack');
const StyleLintPlugin = require('stylelint-webpack-plugin');

const rootDir = path.resolve(__dirname, '../../../');

module.exports = function () {
  return {
    entry: {
      material: path.join(rootDir, './app/Resources/static/themes/material/index.js'),
      baggy: path.join(rootDir, './app/Resources/static/themes/baggy/index.js'),
    },
    output: {
      filename: '[name].js',
      path: path.resolve(rootDir, 'web/bundles/wallabagcore'),
      publicPath: '/bundles/wallabagcore/',
    },
    plugins: [
      new webpack.ProvidePlugin({
        $: 'jquery',
        jQuery: 'jquery',
        'window.$': 'jquery',
        'window.jQuery': 'jquery',
      }),
      new StyleLintPlugin({
        configFile: '.stylelintrc',
        failOnError: false,
        quiet: false,
        context: 'app/Resources/static/themes',
        files: '**/*.scss',
      }),
    ],
    resolve: {
      alias: {
        jquery: path.join(rootDir, 'node_modules/jquery/dist/jquery.js'),
      },
    },
  };
};