forked from AtActionPark/Pianissimo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
44 lines (42 loc) · 948 Bytes
/
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
// We are using node's native package 'path'
// https://nodejs.org/api/path.html
const path = require('path');
const webpack = require('webpack');
// Constant with our paths
const paths = {
DIST: path.resolve(__dirname, 'dist'),
JS: path.resolve(__dirname, ''),
};
// Webpack configuration
module.exports = {
entry: {
'pianissimo.bundle': path.join(paths.JS, 'pianissimo.js'),
'pianissimo.bundle.min': path.join(paths.JS, 'dist/pianissimo.bundle.js'),
},
output: {
path: paths.DIST,
filename: '[name].js',
library: 'pianissimo',
libraryTarget: 'umd',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['env'],
},
},
},
],
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
include: /\.min\.js$/,
minimize: true,
}),
],
};