forked from lbrendanl/SpotifyWDC
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.babel.js
89 lines (87 loc) · 2.44 KB
/
webpack.config.babel.js
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// import webpack from 'webpack';
import { resolve } from 'path';
import ProgressBarPlugin from 'progress-bar-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import InlineManifestWebpackPlugin from 'inline-manifest-webpack-plugin';
import CleanWebpackPlugin from 'clean-webpack-plugin';
import { version, name } from './package.json';
const [MAJOR, MINOR, PATCH] = version.split('.');
export default {
context: resolve('src'),
entry: {
main: ['babel-polyfill', './app.js']
},
devtool: 'cheap-module-source-map',
output: {
path: resolve(`dist/app/`),
publicPath: `/app/`,
filename: `${name}.js`
},
resolve: {
extensions: ['.js']
},
stats: {
colors: true,
reasons: true,
chunks: false
},
externals: {
jquery: 'jQuery'
},
module: {
rules: [
{
enforce: 'pre',
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'eslint-loader'
}
},
{
test: /\.js?$/,
use: {
loader: 'babel-loader'
},
include: [
resolve('src'),
resolve('node_modules/@jaxolotl')
]
},
{
test: /\.html$/,
use: [
{
loader: 'html-loader',
options: { minimize: false }
}
]
},
{
test: /\.(png|jpg|gif|woff|woff2|eot|ttf|svg)$/,
use: {
loader: 'file-loader?limit=100000&name=assets/[hash].[name].[ext]'
}
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader']
}
]
},
plugins: [
new CleanWebpackPlugin(['dist/']),
new ProgressBarPlugin(),
new MiniCssExtractPlugin({
filename: `${name}.${MAJOR}.${MINOR}.${PATCH}.[name].css`,
allChunks: true
}),
new HtmlWebpackPlugin({
template: `./index.html`,
filename: `../index.html`,
minify: false
}),
new InlineManifestWebpackPlugin()
]
};