This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
64 lines (63 loc) · 1.85 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
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyPlugin = require("copy-webpack-plugin");
module.exports = {
entry: './src/index.js',
output: {
filename: 'ctti.js',
path: path.resolve(__dirname, 'docs'),
},
plugins: [
new MiniCssExtractPlugin({
filename: 'ctti.css',
}),
new CopyPlugin({
patterns: [
{ from: "./src/index.html", to: "../docs/" },
{ from: "./src/404.html", to: "../docs/" },
{ from: "./src/awesome-sites.html", to: "../docs/" },
{ from: "./src/blog/index.html", to: "../docs/blog/" },
{ from: "./src/blog/year-in-review-2020/index.html", to: "../docs/blog/year-in-review-2020/" },
{ from: "./src/tools/index.html", to: "../docs/tools/" },
{ from: "./src/about/index.html", to: "../docs/about/" },
{ from: "./src/files/Sage_CRM_Product_Specialist_2021.pdf", to: "../docs/files/" },
{ from: "./src/files/Sophos_Certified_Sales_Consultant.pdf", to: "../docs/files/" },
{ from: "./src/images/cert.svg", to: "../docs/images/" },
{ from: "./src/images/icons/arrow.svg", to: "../docs/images/" },
],
}),
],
module: {
rules: [
{
test: /\.s[ac]ss$/,
use: [
{
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: "./"
},
},
'css-loader',
{
loader: 'sass-loader',
options: {
sourceMap: true,
sassOptions: {
outputStyle: 'compressed',
},
},
},
],
},
{
test: /\.(png|svg|jpg|gif|ico|mp4)$/,
loader: 'file-loader',
options: {
outputPath: 'images',
name: '[name].[ext]',
},
},
],
}
};