Skip to content

Commit

Permalink
fix Webpack loader config for .vanilla.css files
Browse files Browse the repository at this point in the history
  • Loading branch information
mrm007 committed Jul 21, 2023
1 parent 232ec67 commit ef0a636
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,13 @@ class SkuWebpackPlugin {
},
{
// All CSS created by vanilla-extract
test: /\.vanilla.css$/i,
test: /\.vanilla\.css$/i,
// Don't process vanilla files from Playroom as they are handled separately.
// Virtual file paths will look more realistic in the future allowing
// more standard handling of include/exclude path matching.
exclude: /node_modules\/playroom/,
use: makeVanillaCssLoaders({
target,
isProductionBuild,
MiniCssExtractPlugin,
hot,
Expand Down
5 changes: 3 additions & 2 deletions packages/sku/config/webpack/utils/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,11 @@ const makeCssLoaders = (options = {}) => {
};

const makeVanillaCssLoaders = (options = {}) => {
const { isProductionBuild, MiniCssExtractPlugin, browserslist } = options;
const { target, isProductionBuild, MiniCssExtractPlugin, browserslist } =
options;

return [
MiniCssExtractPlugin.loader,
...(target === 'browser' ? [MiniCssExtractPlugin.loader] : []),
{
loader: require.resolve('css-loader'),
options: {
Expand Down

0 comments on commit ef0a636

Please sign in to comment.