-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathrollup.config.js
More file actions
68 lines (66 loc) · 1.57 KB
/
rollup.config.js
File metadata and controls
68 lines (66 loc) · 1.57 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import typescript from '@rollup/plugin-typescript';
import {nodeResolve} from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import postcss from 'rollup-plugin-postcss';
import url from '@rollup/plugin-url';
import wasm from '@rollup/plugin-wasm';
import * as sass from 'sass';
const isProd = (process.env.BUILD === 'production');
const banner =
`/*
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
if you want to view the source visit the plugin's github repository
*/
`;
export default {
input: 'src/main.ts',
output: {
file: 'main.js',
sourcemap: 'inline',
sourcemapExcludeSources: isProd,
format: 'cjs',
exports: 'default',
banner,
inlineDynamicImports: true
},
external: ['obsidian', 'codemirror'],
plugins: [
// WASM plugin must come first to properly handle wasm imports
wasm({
sync: [
'**/cooklang_wasm_bg.wasm'
],
maxFileSize: 10000000 // 10MB limit for WASM files
}),
typescript({
tsconfig: './tsconfig.json',
noEmitOnError: true,
sourceMap: true,
inlineSources: !isProd
}),
nodeResolve({
browser: true,
preferBuiltins: false,
extensions: ['.js', '.ts']
}),
commonjs({
include: ['node_modules/**', 'src/mode/**']
}),
postcss({
extract: 'styles.css',
modules: false,
use: {
sass: {
implementation: sass,
sassOptions: {
outputStyle: 'compressed'
}
}
}
}),
url({
include: ['**/*.mp3'],
limit: 100000
})
]
};