@@ -13,6 +13,7 @@ import { SimplrWebpackOptions } from "./contracts";
1313export function generateWebpackConfig ( opts : SimplrWebpackOptions ) : Configuration {
1414 const options : Required < SimplrWebpackOptions > = {
1515 ...opts ,
16+ htmlOptions : opts . htmlOptions || ( { } as Options ) ,
1617 devServerPort : opts . devServerPort || 3000 ,
1718 entryFile : opts . entryFile || "./src/index.ts" ,
1819 outputDirectory : opts . outputDirectory || "./wwwroot" ,
@@ -30,8 +31,7 @@ export function generateWebpackConfig(opts: SimplrWebpackOptions): Configuration
3031 path : fullOutputDirectoryLocation
3132 } ,
3233 resolve : {
33- // Add `.ts` and `.tsx` as a resolvable extension.
34- extensions : [ ".ts" , ".tsx" , ".js" , ".json" ]
34+ extensions : [ ".ts" , ".tsx" , ".js" , ".json" , ".scss" ]
3535 } ,
3636 module : {
3737 rules : [
@@ -55,6 +55,19 @@ export function generateWebpackConfig(opts: SimplrWebpackOptions): Configuration
5555 }
5656 }
5757 ]
58+ } ,
59+ {
60+ test : / \. s c s s $ / ,
61+ use : [
62+ // Creates style nodes from JS strings.
63+ "style-loader" ,
64+ // // Translates CSS into CommonJS.
65+ // "css-loader",
66+ // Autoprefixer
67+ "postcss-loader" ,
68+ // Compiles Sass to CSS.
69+ "sass-loader"
70+ ]
5871 }
5972 ]
6073 } ,
@@ -68,7 +81,6 @@ export function generateWebpackConfig(opts: SimplrWebpackOptions): Configuration
6881 inject : false ,
6982 template : HtmlWebpackTemplate ,
7083 appMountIds : [ "root" ] ,
71-
7284 links : [
7385 // {
7486 // rel: "stylesheet",
@@ -82,7 +94,8 @@ export function generateWebpackConfig(opts: SimplrWebpackOptions): Configuration
8294 name : "viewport" ,
8395 content : "width=device-width, initial-scale=1"
8496 }
85- ]
97+ ] ,
98+ ...options . htmlOptions
8699 } as Options )
87100 ] ) ,
88101 new ForkTsCheckerWebpackPlugin ( {
0 commit comments