Skip to content

Commit

Permalink
Set public path to match the base config options for mini css loader (#…
Browse files Browse the repository at this point in the history
…316)

* Set public path to match the base config options for mini css loader

* type loader
  • Loading branch information
agubler committed Sep 12, 2019
1 parent 0e6001e commit 9bad4bc
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ export default function webpackConfigFactory(args: any): webpack.Configuration {
}
};

const miniCssExtractLoader: any = {
loader: MiniCssExtractPlugin.loader,
options: {
publicPath: args.base === undefined ? '/' : args.base
}
};

const postcssPresetConfig = {
browsers: isLegacy ? ['last 2 versions', 'ie >= 10'] : ['last 2 versions'],
insertBefore: {
Expand All @@ -312,7 +319,7 @@ export default function webpackConfigFactory(args: any): webpack.Configuration {
};

const postCssModuleLoader = [
MiniCssExtractPlugin.loader,
miniCssExtractLoader,
'@dojo/webpack-contrib/css-module-decorator-loader',
{
loader: 'css-loader',
Expand All @@ -327,7 +334,7 @@ export default function webpackConfigFactory(args: any): webpack.Configuration {
];

const cssLoader = [
MiniCssExtractPlugin.loader,
miniCssExtractLoader,
{
loader: 'css-loader',
options: {
Expand Down Expand Up @@ -634,7 +641,7 @@ export default function webpackConfigFactory(args: any): webpack.Configuration {
test: /\.css$/,
include: /.*(\/|\\)node_modules(\/|\\).*/,
use: [
MiniCssExtractPlugin.loader,
miniCssExtractLoader,
{
loader: 'css-loader',
options: {
Expand Down

0 comments on commit 9bad4bc

Please sign in to comment.