-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
71 lines (69 loc) · 1.7 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
68
69
70
71
const webpack = require('webpack');
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const MergeIntoSingleFilePlugin = require('webpack-merge-and-include-globally');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const config = {
entry: {
libanswers: './src/libanswers.js',
libguides: './src/libguides.js',
azlist: './src/azlist.js',
LibguidesNew: './src/LibguidesNew.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
},
module: {
rules: [
{
test: /\.(png|jpg|gif|svg)$/,
use: [
{
loader: 'file-loader',
options: {
name: '[path][name].[ext]',
context: path.resolve(__dirname, "src/"),
useRelativePaths: true
}
}
]
},
{
test: /\.(woff(2)?|ttf|eot)(\?v=\d+\.\d+\.\d+)?$/,
use: [
{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: 'fonts/'
}
}
]
},
{
test: /\.css$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader'
]
}
]
},
plugins: [
new MiniCssExtractPlugin(),
new OptimizeCssAssetsPlugin(),
new MergeIntoSingleFilePlugin({
files: {
"vendor.js": [
'node_modules/jquery-once/jquery.once.min.js',
path.resolve(__dirname, 'src/js/*.js'),
],
}
}),
new CopyWebpackPlugin([
{from:'src/images',to:'images'}
]),
],
};
module.exports = config;