-
Notifications
You must be signed in to change notification settings - Fork 0
/
stencil.config.ts
52 lines (49 loc) · 1.36 KB
/
stencil.config.ts
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
import { Config } from '@stencil/core';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import visualizer from 'rollup-plugin-visualizer';
import { sass } from '@stencil/sass';
import dotenv from 'dotenv';
dotenv.config();
const env = process.env;
// https://stenciljs.com/docs/config
export const config: Config = {
globalStyle: 'src/global/app.scss',
globalScript: 'src/global/app.ts',
taskQueue: 'async',
buildEs5: 'prod', // false | 'prod' | true
outputTargets: [
{
type: 'www',
// comment the following line to disable service workers in production
serviceWorker: null,
baseUrl: '/',
copy: [
{ src: 'global/assets', dest: 'assets' },
{ src: 'custom/assets', dest: 'assets' },
],
},
],
plugins: [sass(), env.npm_lifecycle_event === 'analyze' ? visualizer() : null],
rollupPlugins: {
before: [
nodeResolve({
preferBuiltins: false,
browser: true,
modulesOnly: true,
mainFields: [],
}),
],
},
testing: {
browserArgs: ['--no-sandbox', '--disable-setuid-sandbox'],
moduleDirectories: ['node_modules', 'src'],
},
devServer: {
port: parseInt(env.PORT ?? '3434', 10),
},
env: {
ENVIRONMENT: env.ENVIRONMENT,
API_BASE_URL: env.API_BASE_URL,
FALLBACK_CERTIFICATE: env.FALLBACK_CERTIFICATE?.replace(/\\n/g, '\n'),
},
};