-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
webpack.config.js
35 lines (34 loc) · 974 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
const path = require('path');
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const pkg = require('./package.json');
module.exports = {
mode: process.env.NODE_ENV || 'production',
entry: [
'./src/flexmasonry.css',
'./src/flexmasonry.js',
],
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'flexmasonry.js',
library: 'FlexMasonry',
libraryExport: 'default',
libraryTarget: 'var',
},
module: {
rules: [
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
}
]
},
plugins: [
new MiniCssExtractPlugin({
filename: 'flexmasonry.css',
}),
new webpack.BannerPlugin({
banner: 'FlexMasonry\nVersion: ' + pkg.version + '\nAuthor: ' + pkg.author + '\nLicense: ' + pkg.license
}),
],
};