forked from heiseonline/embetty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
67 lines (64 loc) · 1.53 KB
/
webpack.config.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
const {
author,
contributors,
homepage,
license,
name,
title,
version,
} = require('./package.json')
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const path = require('path')
const webpack = require('webpack')
const prod = process.argv.indexOf('-p') !== -1
module.exports = {
entry: {
embetty: [
'./polyfills.js',
'./index.js'
]
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
},
devtool: (prod && 'none') || 'inline-source-map',
mode: (prod && 'production') || 'development',
module: {
rules: [
{
test: /\.js$/,
exclude: /custom-elements-es5-adapter/,
use: [
'cache-loader',
'babel-loader'
]
},
{
test: /\.scss$/,
use: [
'css-loader',
'postcss-loader',
'sass-loader'
]
},
{
test: /^custom-elements-es5-adapter\.js$/,
use: [
'raw-loader'
]
}
]
},
plugins: [
new webpack.IgnorePlugin(/vertx/), // see https://github.com/parcel-bundler/parcel/issues/141
new BundleAnalyzerPlugin({ analyzerMode: 'static', openAnalyzer: false }),
new webpack.BannerPlugin({
banner: `${title || name} - v${version} - ${(new Date()).toGMTString()}
${homepage}
Copyright (c) ${(new Date()).getFullYear()} Heise Medien GmbH & Co. KG
Contributors: ${author.name}, ${contributors.map(c => c.name).join(', ')}
Licensed under the ${license} license`
})
],
}