-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.js
56 lines (54 loc) · 1.63 KB
/
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
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
import typescript from "rollup-plugin-typescript2";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import url from "@rollup/plugin-url";
import terser from "@rollup/plugin-terser";
export default {
input: "index.ts", // Your entry point
output: [
{
file: "dist/bundle.js",
format: "iife", // Immediately Invoked Function Expression for standalone bundle
name: "storefront", // Global variable name for your library
sourcemap: true,
},
{
file: "dist/bundle.min.js",
format: "iife", // Immediately Invoked Function Expression for standalone bundle
name: "storefront", // Global variable name for your library
sourcemap: true,
plugins: [terser()], // Minify this output
},
],
plugins: [
nodeResolve({
browser: true,
}),
commonjs(),
typescript({
tsconfig: "./sdk-tsconfig.json",
}),
url({
include: [
"**/*.svg",
"**/*.png",
"**/*.jpg",
"**/*.jpeg",
"**/*.gif",
"**/*.webp",
], // Include all image
limit: 0, // Don't inline, just copy to dist
destDir: "dist/assets/images", // Destination directory
}),
url({
include: ["**/*.woff", "**/*.woff2", "**/*.ttf", "**/*.eot"], // Include all font files
limit: 0, // Don't inline, just copy to dist
destDir: "dist/assets/fonts", // Destination directory
}),
url({
include: ["**/*.mp3"], // Include all sounds
limit: 0, // Don't inline, just copy to dist
destDir: "dist/assets/sound", // Destination directory
}),
],
};