-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstencil.config.ts
94 lines (89 loc) · 3.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import { Config } from '@stencil/core';
import { sass } from '@stencil/sass';
import { postcss } from '@stencil/postcss';
import autoprefixer from 'autoprefixer';
import { OutputTargetCopy } from '@stencil/core/internal';
/* import includePaths from 'rollup-plugin-includepaths';
const includePathOptions = {
include: {
'@upradata/util': 'node_modules/@upradata/util/lib-esm/index.js'
},
// paths: [ 'src/lib', 'src/other' ],
external: [],
extensions: [ '.mjs', '.js', '.json', '.html' ]
}; */
export const config: Config = {
namespace: 'upradata',
taskQueue: 'async',
excludeUnusedDependencies: true,
// buildEs5: false,
plugins: [
// includePaths(includePathOptions),
sass(),
postcss({
/* injectGlobalPaths: [ // The injectGlobalPaths config is an array of paths that automatically get added as @import declarations to all components.
'src/globals/variables.pcss',
'src/globals/mixins.pcss'
], */
plugins: [ autoprefixer(/* {
browsers: [ 'last 6 versions' ],
cascade: false
} */) ]
})
],
// commonjs: {
// include: '/home/milottit/Libraries/Util/**/node_modules/**/*.js', // /Libraries\/Util\/(.*)\/node_modules/,
// namedExports: {
// // '../../Util/util/node_modules/.pnpm/[email protected]/node_modules/ts-util-is/dist/index.js': [ 'isUndefined', 'isNull' ],
// '../../Util/util/node_modules/.pnpm/registry.npmjs.org/colors/1.4.0/node_modules/colors/lib/colors.js': [ 'isUndefined', 'isNull' ],
// }
// },
/* commonjs: {
include: [ /node_modules/, /lib-esm/ ],
namedExports: {
'../../Util/util/node_modules/.pnpm/[email protected]/node_modules/ts-util-is/dist/index.js': [ 'isUndefined', 'isDefined', 'isNull' ],
'../../Util/util/lib-esm/is.js': [ 'isUndefined', 'isDefined', 'isNull' ],
'/home/milottit/Libraries/Util/util/lib-esm/is.js': [ 'isUndefined', 'isDefined', 'isNull' ],
},
transformMixedEsModules: false
} as any, */
globalStyle: 'src/global/global.scss',
globalScript: 'src/global/global.ts',
hashFileNames: true,
preamble: 'Built by Upra-Data.\nCopyright © Upra-Data SARL',
hashedFileNameLength: 8,
invisiblePrehydration: true,
buildEs5: 'prod',
outputTargets: [
{
type: 'dist',
esmLoaderPath: '../loader',
copy: [
{ src: 'fonts/*.woff2', dest: 'static/fonts', warn: true }
]
},
{
type: 'dist-custom-elements',
},
{
type: 'docs-readme'
},
{
type: 'www',
serviceWorker: null, // disable service workers
copy: [
{ src: 'fonts/*.woff2', dest: 'static/fonts', warn: true }
]
}
]
};
const isDev = process.argv.some(arg => arg === '--dev');
if (isDev) {
for (const target of config.outputTargets.filter(target => (target as OutputTargetCopy).copy)) {
(target as OutputTargetCopy).copy.push(
{ src: 'test-components/*', dest: 'static/test/html', warn: true },
{ src: 'global/tilda*.css', dest: 'static/test/css', warn: true },
{ src: 'fonts/*', dest: 'static/fonts', warn: true },
);
}
}