File tree 3 files changed +13
-2
lines changed
3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -3,3 +3,4 @@ node_modules
3
3
bundle. *
4
4
public /build
5
5
src /css
6
+ component.css *
Original file line number Diff line number Diff line change 15
15
},
16
16
"scripts" : {
17
17
"pre-build" : " foundation --targetDirectory=src/css" ,
18
- "build" : " npm-run-all --print-label pre-build --parallel build:*" ,
18
+ "build" : " npm-run-all --print-label --parallel pre-build build-css --parallel build:*" ,
19
19
"build:js" : " rollup -c" ,
20
20
"build-dev" : " cross-env ENVIRONMENT=dev npm run build" ,
21
+ "build-css" : " cross-env OUTPUT_CSS_FILE=component.css npm run build:js" ,
21
22
"dev:serve" : " live-server public" ,
22
23
"dev:watch:js" : " npm run build:js -- -w" ,
23
24
"dev" : " npm-run-all --print-label pre-build --parallel dev:**" ,
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ const stylePreprocessor = sveltePreprocessPostcss({
15
15
16
16
const customElement = process . env . OUTPUT === "custom-element"
17
17
const devMode = ! ! process . env . ROLLUP_WATCH || process . env . ENVIRONMENT === 'dev'
18
+ const outputCssFile = process . env . OUTPUT_CSS_FILE || false
18
19
const testApp = devMode && ! customElement
19
20
20
21
const outputFileName = customElement
@@ -25,6 +26,13 @@ const outputPath = devMode
25
26
? "./public/build/" + outputFileName
26
27
: "./" + outputFileName
27
28
29
+ const extraSvelteOptions = outputCssFile
30
+ ? {
31
+ cssOutputFilename : outputCssFile ,
32
+ css : css => css . write ( outputCssFile ) ,
33
+ }
34
+ : { }
35
+
28
36
const componentConfig = {
29
37
input : "src/DateRangeInput.svelte" ,
30
38
output : {
@@ -47,7 +55,8 @@ const componentConfig = {
47
55
}
48
56
49
57
handler ( warning )
50
- }
58
+ } ,
59
+ ...extraSvelteOptions
51
60
} ) ,
52
61
resolve ( {
53
62
browser : true ,
You can’t perform that action at this time.
0 commit comments