forked from googlefonts/fontra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
27 lines (26 loc) · 869 Bytes
/
rollup.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
import commonjs from "@rollup/plugin-commonjs";
import nodeResolve from "@rollup/plugin-node-resolve";
const dependencies = require("./package.json").dependencies;
export default Object.keys(dependencies)
.map((depName) => {
return {
input: `node_modules/${depName}`,
output: {
file: `src/fontra/client/third-party/${depName}.js`,
inlineDynamicImports: true,
},
plugins: [
commonjs(), // <-- this handles some parsing of js syntax or something (necessary for `export { init } from "mathjax";`)
nodeResolve({ browser: true }), // <-- this allows npm modules to be added to bundle
],
};
})
.concat({
input: [
"node_modules/lib-font/lib/inflate.js",
"node_modules/lib-font/lib/unbrotli.js",
],
output: {
dir: "src/fontra/client/third-party/lib-font/",
},
});