-
Notifications
You must be signed in to change notification settings - Fork 0
/
further_adjustments.js
38 lines (32 loc) · 1.08 KB
/
further_adjustments.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
// for both webpack.config.js and karma.conf.js
const extraEntry = {
'webcomponents-loader': '@webcomponents/webcomponentsjs/webcomponents-loader.js',
};
config.entry = config.entry != null ? Object.assign(config.entry, extraEntry) : extraEntry;
if (config.output != null) {
const kotlinJsFilename = config.output.filename;
config.output.filename = chunkData =>
chunkData.chunk.name in extraEntry ? "[name].js" : kotlinJsFilename(chunkData);
}
else
config.output = { filename: "[name].js" };
// see: https://github.com/material-components/material-components-web/blob/master/docs/getting-started.md
const mainEntryExtras = ['./kotlin/app.scss',];
if (config.entry.main != null)
config.entry.main.push(...mainEntryExtras);
else
config.entry.main = mainEntryExtras;
config.module.rules.push({
test: /\.scss$/,
use: [
{
loader: 'file-loader',
options: {
name: 'app.css',
},
},
{ loader: 'extract-loader' },
{ loader: 'css-loader' },
{ loader: 'sass-loader' },
],
});