forked from material-shell/material-shell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrollup.config.prefs.js
35 lines (33 loc) · 946 Bytes
/
rollup.config.prefs.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
import alias from '@rollup/plugin-alias';
import resolve from '@rollup/plugin-node-resolve';
import * as path from 'path';
import copy from 'rollup-plugin-copy';
const projectRootDir = path.resolve(__dirname) + '/build';
console.log(projectRootDir);
const customResolver = resolve({
extensions: ['.mjs', '.js', '.jsx', '.json', '.sass', '.scss'],
});
export default {
input: 'build/prefs/prefs.js',
output: {
file: 'dist/prefs.js',
format: 'es',
},
treeshake: false,
plugins: [
alias({
entries: [
{
find: 'src',
replacement: path.resolve(projectRootDir),
// OR place `customResolver` here. See explanation below.
},
],
customResolver,
}),
copy({
targets: [{ src: 'src/prefs/ui/*', dest: 'dist/' }],
}),
resolve(),
],
};