-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaunty.config.js
46 lines (39 loc) · 1.2 KB
/
aunty.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
const path = require('path');
const fs = require('fs');
const includedDependencies = [/carbon-/, /@abcnews\/svelte-scrollyteller/];
const getLoaderDefinition = (config, testSourceMatch, loaderMatch) =>
config.module.rules
.find(({ test }) => test?.source.indexOf(testSourceMatch) > -1)
.use.find(({ loader }) => loader.indexOf(loaderMatch || testSourceMatch) > -1);
module.exports = {
type: 'svelte',
build: {
includedDependencies,
entry: ['index']
},
webpack: config => {
// De-dupe svelte
config.resolve.alias = {
...(config.resolve.alias || {}),
svelte: path.resolve('node_modules', 'svelte')
};
// Disable dart-sass warnings
getLoaderDefinition(config, 'scss', 'sass').options = { sassOptions: { quietDeps: true } };
// console.log(config);
// Disable svelte warnings when compiling dependencies
getLoaderDefinition(config, 'svelte').options.onwarn = (warning, handler) => {
for (const pattern of includedDependencies) {
if (pattern.test(warning.filename)) {
return;
}
}
handler(warning);
};
return config;
},
deploy: [
{
to: '/www/res/sites/news-projects/<name>/<id>'
}
]
};