forked from lit/lit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwtr-config.js
57 lines (53 loc) · 1.92 KB
/
wtr-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
57
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
import * as pathLib from 'path';
import {fileURLToPath} from 'url';
const packagesDir = pathLib.resolve(
pathLib.dirname(fileURLToPath(import.meta.url)),
'..'
);
/**
* rollup-resolve-remap config that remaps any lit-html or lit-element imports
* to their minified production versions (works for both bare and path module
* specifiers).
*/
export const prodResolveRemapConfig = {
root: packagesDir,
remap: [
// The development/test/ directories are special, there are no production
// versions of these.
{from: 'lit-html/development/test/', to: null},
{from: 'lit-element/development/test/', to: null},
{from: 'reactive-element/development/test/', to: null},
// Remap any other development/ modules up one level to the production
// version.
{from: 'lit-html/development/', to: 'lit-html/'},
{from: 'lit-element/development/', to: 'lit-element/'},
{from: 'reactive-element/development/', to: 'reactive-element/'},
],
};
/**
* rollup-resolve-remap config that remaps any lit-html or lit-element imports
* to the un-minified development versions.
*/
export const devResolveRemapConfig = {
root: packagesDir,
remap: [
// Don't remap external dependencies.
{from: 'lit-html/node_modules/', to: null},
{from: 'lit-element/node_modules/', to: null},
{from: 'reactive-element/node_modules/', to: null},
// If we're already reaching into development/, nothing to change.
{from: 'lit-html/development/', to: null},
{from: 'lit-element/development/', to: null},
{from: 'reactive-element/development/', to: null},
// Everything else is a production version; remap to the development
// version.
{from: 'lit-html/', to: 'lit-html/development/'},
{from: 'lit-element/', to: 'lit-element/development/'},
{from: 'reactive-element/', to: 'reactive-element/development/'},
],
};