aboutsummaryrefslogtreecommitdiff
path: root/juick-www/webpack.config.js
blob: 54c9114d7152cc89d4baa0de0300d8ef10070cd4 (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
var webpack = require("webpack")
var ExtractTextPlugin = require("extract-text-webpack-plugin")
var StyleLintPlugin = require('stylelint-webpack-plugin')
var AssetPipelinePlugin = require('webpack-asset-pipeline')

module.exports = {
    devtool: 'source-map',
    entry: {
        "scripts" : [
            __dirname + "/src/main/static/scripts.js",
            require.resolve('evil-icons/assets/evil-icons.js')
        ],
        "style" : [
            __dirname + "/src/main/static/style.css",
            require.resolve('evil-icons/assets/evil-icons.css'),
            require.resolve('awesomplete/awesomplete.css')
        ]
    },
    output: {
        path: __dirname + "/src/main/resources",
        filename: "[name].[hash].js"
    },
    module: {
        loaders: [
            { test: /\.jsx?$/, loader: 'eslint-loader', enforce: 'pre', exclude: /node_modules/, options: { failOnWarning: false, failOnError: true }},
            { test: /\.js$/, loader: 'babel-loader', query: { presets: ['es2015'] }},
            { test: /\.css$/, loader: ExtractTextPlugin.extract({ fallback: "style-loader", use: "css-loader" }) },
            { test: /\.png$/, loader: "url-loader?limit=10000000000" },
            { test: /\.svg$/, loader: "url-loader?limit=10000000000" }
        ]
    },
    plugins: [
        new webpack.optimize.ModuleConcatenationPlugin(),
        new StyleLintPlugin({ configFile: '.stylelintrc.json', context: 'src/main/static', files: ['**/*.css'], emitErrors: false }),
        new ExtractTextPlugin({ filename: "style.[hash].css", allChunks: true }),
        new AssetPipelinePlugin()
    ],

}