aboutsummaryrefslogtreecommitdiff
path: root/juick-www/webpack.config.js
blob: fd29405a7944dc4b84f361b16ee85535a94efb50 (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
40
41
42
43
44
45
46
47
48
49
const webpack = require("webpack")
const ExtractTextPlugin = require("extract-text-webpack-plugin")
const StyleLintPlugin = require('stylelint-webpack-plugin')

module.exports = {
    devtool: 'source-map',
    entry: {
        "scripts": [
            __dirname + "/src/main/assets/scripts.js",
            require.resolve('evil-icons/assets/evil-icons.js')
        ],
        "style": [
            __dirname + "/src/main/assets/style.css",
            require.resolve('evil-icons/assets/evil-icons.css'),
            require.resolve('awesomplete/awesomplete.css')
        ]
    },
    output: {
        path: __dirname + "/src/main/resources/static",
        filename: "[name].js"
    },
    module: {
        rules: [
            { test: /\.jsx?$/, loader: 'eslint-loader', enforce: 'pre', exclude: /node_modules/, options: { failOnWarning: false, failOnError: true, fix: true } },
            { test: /\.js$/, loader: 'babel-loader', query: { presets: ['env'] } },
            {
                test: /\.css$/, loader: ExtractTextPlugin.extract({
                    fallback: "style-loader",
                    use: ["css-loader", {
                        loader: "postcss-loader", options: {
                            plugins: () => [
                                require('autoprefixer')({
                                    browsers: 'last 4 versions, > 1%, ie >= 8'
                                })
                            ]
                        }
                    }]
                })
            },
            { test: /\.png$/, loader: "url-loader?limit=10000000000" },
            { test: /\.svg$/, loader: "url-loader?limit=10000000000" }
        ]
    },
    plugins: [
        new StyleLintPlugin({ configFile: '.stylelintrc.json', context: 'src/main/assets', files: ['**/*.css'], emitErrors: false }),
        new ExtractTextPlugin({ filename: "style.css", allChunks: true })
    ],

}