forked from WorldBrain/Memex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatic-files.js
45 lines (43 loc) · 1.27 KB
/
static-files.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
/**
* Everything in here gets injected into the generated HTML as link/script tags.
* See: https://github.com/jharris4/html-webpack-include-assets-plugin#example
*/
export const htmlAssets = [
'fonts/Inter/inter.css',
'lib/browser-polyfill.js',
]
/**
* Set the manifest version to be equal to `package.json` version.
*/
function transformManifestVersion(content) {
const manifest = JSON.parse(content.toString())
manifest.version = process.env.npm_package_version
return Buffer.from(JSON.stringify(manifest))
}
/**
* Everything in here gets copied as-is to the output dir.
* See: https://github.com/webpack-contrib/copy-webpack-plugin#usage
*/
export const copyPatterns = [
{
from: 'src/manifest.json',
to: '.',
transform: transformManifestVersion,
},
{ from: 'img', to: 'img' },
{
from: 'node_modules/webextension-polyfill/dist/browser-polyfill.js',
to: 'lib/',
},
{ from: 'node_modules/pdfjs-dist/build/pdf.worker.min.js', to: 'lib/' },
{
from: 'fonts/*/*',
to: 'fonts/Inter/[name].[ext]',
},
{
from:
'node_modules/material-design-icons/iconfont/*.{eot,ttf,woff,woff2,css}',
to: 'fonts/material-icons/[name].[ext]',
toType: 'template',
},
]