forked from ReDI-School/js-2025-spring
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebpack.config.js
More file actions
51 lines (49 loc) · 2.02 KB
/
Copy pathwebpack.config.js
File metadata and controls
51 lines (49 loc) · 2.02 KB
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
const path = require("path");
const CopyWebpackPlugin = require("copy-webpack-plugin");
/**
* @type {import('webpack').Configuration}
*/
const config = {
entry: "./main.js", // Webpack needs an entry point, even if it's just HTML
output: {
path: path.resolve(__dirname, "dist"),
filename: "main.js",
},
plugins: [
new CopyWebpackPlugin({
patterns: [
{
from: "index.html",
to: "index.html",
transform: content => content.toString()
.replaceAll("https://unpkg.com/reveal.js@^4/", "")
.replaceAll("https://unpkg.com/highlight.js@10/", ""),
},
{ from: "style.css", to: "style.css" },
{ from: "toc.md", to: "toc.md" },
{ from: "lesson*.md" },
{ from: "images", to: "images" },
{ from: "node_modules/reveal.js/dist/reset.css", to: "dist/reset.css" },
{ from: "node_modules/reveal.js/dist/reveal.css", to: "dist/reveal.css" },
{ from: "node_modules/reveal.js/dist/theme/black.css", to: "dist/theme/black.css" },
{ from: "node_modules/reveal.js/dist/reveal.js", to: "dist/reveal.js" },
{ from: "node_modules/reveal.js/plugin/markdown/markdown.js", to: "plugin/markdown/markdown.js" },
{ from: "node_modules/reveal.js/plugin/highlight/highlight.js", to: "plugin/highlight/highlight.js" },
{ from: "node_modules/reveal.js/plugin/zoom/zoom.js", to: "plugin/zoom/zoom.js" },
{ from: "node_modules/reveal.js/plugin/search/search.js", to: "plugin/search/search.js" },
{ from: "node_modules/reveal.js/dist/theme/fonts", to: "dist/theme/fonts" },
{ from: "node_modules/highlight.js/styles/vs2015.min.css", to: "styles/vs2015.css" },
{ from: "arrays", to: "arrays" },
{ from: "bookstore", to: "bookstore" },
{ from: "functions", to: "functions" },
{ from: "objects", to: "objects" },
{ from: "project", to: "project" },
],
}),
],
mode: "production",
optimization: {
minimize: false,
}
};
module.exports = config;