-
Notifications
You must be signed in to change notification settings - Fork 2
/
rollup.config.js
executable file
·42 lines (41 loc) · 1.11 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
/* eslint-disable no-console */
const path = require('path');
const lwcCompiler = require('@lwc/rollup-plugin');
const replace = require('rollup-plugin-replace');
const cleaner = require('rollup-plugin-cleaner');
const copy = require('rollup-plugin-cpy');
const copySldsAssets = require('rollup-slds-plugin');
const useMyIcon = require('./rollup/use-my-icon');
module.exports = {
input: path.resolve('src/index.js'),
output: {
file: path.resolve('build/app.js'),
format: 'iife',
},
plugins: [
cleaner({
targets: [
'./build/',
],
}),
copy({
files: ['src/index.html'],
dest: 'build',
options: {
verbose: true,
},
}),
copySldsAssets({ dest: 'build/assets' }),
useMyIcon(),
lwcCompiler({
mapNamespaceFromPath: true,
resolveFromPackages: true,
}),
replace({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
}),
],
watch: {
exclude: ['node_modules/**'],
},
};